Settings Class

Assembly: CodeEffects.Rule.Editor.dll
Namespace: CodeEffects.Rule.Editor.Client

Summary

Holds the type-specific settings of a Field, Parameter, or Return in an Adaptive Source: the allowed range of a number or length of a string, the format of a date or time, the time type, the data source name, and so on. Each setting applies to some data types only and is ignored for the others, as noted for each property.

Syntax

public class Settings

Constructors

  • Settings()

    Creates settings with these defaults: AllowDecimals, IncludeInCalculations, and IncludeInConcatenations are true; AllowCalculations and AllowConcatenations are false; StringComparison is StringComparison.OrdinalIgnoreCase; TimeType is TimeType.TimeOfDay.

Properties

  • Min

    Type: System.Nullable<System.Decimal>

    For numeric types, the minimum value users may enter. The default value is null, meaning no minimum.

  • Max

    Type: System.Nullable<System.Decimal>

    For numeric types, the maximum value users may enter. For strings, the maximum length of the value. The default value is null, meaning no maximum.

  • StringComparison

    Type: System.StringComparison

    The string comparison used when the string element is compared in a rule (stored in the rule's conditions). The default value is StringComparison.OrdinalIgnoreCase.

  • AllowDecimals

    Type: System.Boolean

    For numeric types, indicates whether users may enter decimal values. The default value is true.

  • AllowCalculations

    Type: System.Boolean

    For numeric types, indicates whether users may enter a calculation as the value of the element. The default value is false.

  • IncludeInCalculations

    Type: System.Boolean

    For numeric types, indicates whether the element can be used in calculations of other elements. The default value is true.

  • AllowConcatenations

    Type: System.Boolean

    For string types, indicates whether users may enter a concatenation of strings as the value of the element. The default value is false.

  • IncludeInConcatenations

    Type: System.Boolean

    For string types, indicates whether the element can be used in concatenations of other elements. The default value is true.

  • Format

    Type: System.String

    For date and time types, the format in which the Rule Editor displays the value. For a time of day or a date, it is a .NET date and time format string. For a time whose TimeType is Duration, it is a TimeSpan format that names the duration's units with the tokens d, hh, mm, and ss: a unit the format lacks is not part of the value, and the largest unit is unbounded. See TimeType. The default value is null.

  • Offset

    Type: System.Boolean

    For the date type, indicates that the value is a DateTimeOffset, picked together with a UTC offset, and that the displayed value always includes the offset. Setting TypeOrAliasName to System.DateTimeOffset has the same effect. The default value is false.

  • TimeType

    Type: CodeEffects.Rule.Common.Models.TimeType

    For the time type, tells whether a TimeSpan is a time of day (TimeType.TimeOfDay, the default) or a duration (TimeType.Duration). A duration has its own picker, operators, and display, and the units it has are named by Format. Only TimeSpan can be a duration; a TimeOnly is always a time of day. Changing it counts as a change of the source.

  • TypeOrAliasName

    Type: System.String

    The full name or alias of the element's type. For enumeration elements it names the enumeration. For dates, System.DateTimeOffset makes the date an offset date.

  • DataSourceName

    Type: System.String

    For string and numeric types, the name of the Dynamic Menu Data Source that supplies the element's menu. It matches the Name of a DataSource of the same source. The default value is null.

Example

using CodeEffects.Rule.Common.Models;
using CodeEffects.Rule.Editor.Client;

// A whole number from 1 to 10
var numeric = new Settings { AllowDecimals = false, Min = 1, Max = 10 };

// A duration shown as days, hours and minutes
var duration = new Settings { TimeType = TimeType.Duration, Format = "d.hh:mm" };

Ask on Stack Overflow - Yes, it's still active
Ask in GitHub Discussions

p102

l097 --

l102

p101

×