2using System.Text.RegularExpressions;
3using System.Threading.Tasks;
23 private string contentType;
36 [
Page(2,
"Script", 100)]
37 [Header(63,
"Content-Type:")]
38 [ToolTip(64,
"Content-Type of text.")]
42 get => this.contentType;
45 if (!
string.IsNullOrEmpty(value) && (
49 throw new NotSupportedException(
"Content-Type not supported.");
52 this.contentType = value;
59 [
Page(2,
"Script", 100)]
60 [Header(29,
"Default value:")]
61 [ToolTip(30,
"Default value presented to user.")]
62 [DynamicContentType(
"GetContentType")]
68 [
Page(2,
"Script", 100)]
69 [Header(68,
"Minimum Count:")]
70 [ToolTip(69,
"The smallest amount of items accepted.")]
76 [
Page(2,
"Script", 100)]
77 [Header(70,
"Maximum Count:")]
78 [ToolTip(71,
"The largest amount of items accepted.")]
87 return string.IsNullOrEmpty(this.contentType) ? PlainTextCodec.DefaultContentType : this.contentType;
111 if (this.
MinCount.HasValue ||
this.MaxCount.HasValue)
118 false,
false,
false);
124 false,
false,
false,
this.GetContentType());
157 if (s is
null || s.Length == 0)
168 if (this.
MinCount.HasValue && s.Length <
this.MinCount.Value)
170 else if (this.
MaxCount.HasValue && s.Length >
this.MaxCount.Value)
Static class managing encoding and decoding of internet content.
static string[] CanDecodeContentTypes
Internet content types that can be decoded.
static bool IsAccepted(string ContentType, params string[] AcceptedContentTypes)
Checks if a given content type is acceptable.
static string[] CanEncodeContentTypes
Internet content types that can be encoded.
Static class managing editable parameters in objects. Editable parameters are defined by using the at...
Class managing a page in a data form layout.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Represents a parameter with possible options on a command.
bool RestrictToOptions
Optional minimum value allowed.
async Task< KeyValuePair< string, string >[]> GetOptions()
Gets available options, if any are defined.
Represents a text-valued script parameter.
override async Task PopulateForm(DataForm Parameters, Language Language, object Value)
Populates a data form with parameters for the object.
override async Task SetParameter(DataForm Parameters, Language Language, bool OnlySetChanged, Variables Values, SetEditableFormResult Result)
Sets the parameters of the object, based on contents in the data form.
ushort? MaxCount
Maximum amount of JIDs expected.
string ContentType
Internet Content-Type of text value.
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
string GetContentType()
Gets the Content-Type of the text value of the parameter.
ushort? MinCount
Minimum amount of JIDs expected.
ScriptTextParameterNode()
Represents a text-valued script parameter.
string[] DefaultValue
Default parameter value.
string Label
Parameter label.
bool Required
If parameter is required.
string Description
Parameter description.
string ParameterName
Parameter name.
string Page
Parameter name.