-
Type: System.Collections.Generic.ICollection<MenuItem>
Gets or sets the collection of reusable rules that can be added to the field menus in the Rule Editor. Only rules of the evaluation type should be included in this collection. Such rules appear in the field menu as regular fields of the System.Bool type. It is up to the developer to determine which existing evaluation-type rules, if any, should be made available in the context menu. An Adaptive Source ignores this property: its ISourceProvider returns reusable rules from GetFieldsAndMethods as fields with IsRule set and resolves them with GetReusableRule. This property is optional. The default value is an empty collection of type List<MenuItem>.
DataSources
Type: System.Collections.Generic.ICollection<DataSourceHolder>
Gets or sets the collection of named GetDataSourceDelegate delegates. Each delegate in the collection is represented by an instance of the DataSourceHolder class. See the Customizable Dynamic Data Sources topic for details. This property is optional. The default value is an empty collection of type List<DataSourceHolder>.
EvaluationMode
Type: CodeEffects.Rule.Common.Models.EvaluationMode
Gets or sets the current mode of the Rule Editor, which defines what kind of rules rule authors can create.
The Evaluation value limits the editor to evaluation type rules. The Execution value allows both evaluation and execution type rules (in this mode, the evaluation type is the default). The Loop and Ruleset values select the other modes of the editor. The Filter value is deprecated. See the Understanding Modes topic for details.
When you load a rule with LoadRuleData, the editor changes this value from Evaluation to Execution for a rule of execution type and from Execution to Evaluation for a rule of evaluation type. The default value is Evaluation.
ExcludedOperators
Type: System.Collections.Generic.ICollection<Operator>
Gets or sets the collection of operators that should be excluded from menus of the Rule Editor. The Rule Editor automatically includes only the operators required for the data types used by the source object. For example, if the source object does not contain any members of the System.DateTime type, the Rule Editor will automatically exclude all date operators from the client-side settings. However, developers may occasionally need to explicitly exclude certain operators for existing data types. The following code example demonstrates how to exclude the string operators startsWith, doesntStartWith, endsWith, and doesntEndWith:
control.ExcludedOperators.Add(
new CodeEffects.Rule.Common.Models.Operator
{
Type = CodeEffects.Rule.Common.Models.OperatorType.String,
ExcludedOperator =
ExcludedOperator.StartsWith |
ExcludedOperator.DoesNotStartWith |
ExcludedOperator.EndsWith |
ExcludedOperator.DoesNotEndWith
});
This property is optional. The default value is an empty collection of type List<Operator>.
GetRuleDelegate
Type: CodeEffects.Rule.Common.Models.GetRuleDelegate
Deprecated. This property will be removed in one of the future versions. Use RuleResolver instead.
HelpXml
Type: System.Xml.XmlDocument
Gets or sets the XmlDocument object that contains custom help, warning, and validation messages used in the Help String, as well as all UI labels and values displayed by the Rule Editor in the Rule Area. In Code Effects, this document is referred to as Help XML. It plays a key role in providing multilingual support.
By default, the editor uses the English version of the Help XML document compiled into the CodeEffects.Rule.Editor.dll assembly. You can load this default document by calling the GetDefaultHelpXml() method in debugger mode, save its OuterXml string, and use it as a template for translation into other languages or to modify the default English version as needed.
For more information, see the Help XML and Multilingual Support topic.
HelpXmlFile
Type: System.String
Gets or sets the full path to the XML file that contains the customized Help XML document.
ID
Type: System.String
Gets or sets the ID of the HTML element that hosts the Rule Editor on the client.
InlineRules
Type: System.Collections.Generic.ICollection<MenuItem>
Gets or sets the collection of rules that a rule of execution type can execute from its THEN and ELSE sections. The editor lists them under the Execute... item of the actions menu ("... and execute Rule Name"). This collection should contain only rules of execution type; the editor does not enforce it. The Rule Engine runs an executed rule in place and in order, and discards its result. The editor ignores this property in the Evaluation mode and for an Adaptive Source, whose provider supplies the rules with GetInlineRules. This property is optional. The default value is an empty collection of type List<MenuItem>.
IsAdaptiveSource
Type: System.Boolean
Gets a value indicating whether the editor uses an Adaptive Source. It is true after you set SourceProvider to an instance of ISourceProvider and false when you set it back to null.
IsEmpty
Type: System.Boolean
Gets a value indicating whether the Rule Area is empty (contains no rule elements).
IsValid
Type: System.Boolean
Gets a value indicating whether the submitted rule has passed automatic validation. The Rule Editor performs automatic validation each time a rule is submitted. If validation fails, the Rule Area highlights all invalid rule elements, and rule authors can hover the mouse pointer over each invalid element to view a description of the corresponding validation issue. If enabled, the Help String displays a relevant error message. The default English descriptions and messages can be customized by modifying the Help XML document.
KeepDeclaredOrder
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should alphabetically order fields, in-rule methods, and rule actions in menus, or retain the order in which they are declared in the source object. The default value is false.
Rule
Type: CodeEffects.Rule.Editor.Models.RuleModel
Gets the instance of the rule that is currently loaded in the Rule Editor. The property has no public setter; the editor sets it when you load a rule with one of the Load... methods.
RuleGetter
Type: CodeEffects.Rule.Common.Models.GetRuleDelegate
Deprecated. This property will be removed in one of the future versions. Use RuleResolver instead.
RuleNameIsRequired
Type: System.Boolean
Gets or sets the value indicating whether Rule Editor should require each rule to have a name when the rule author uses Toolbar to save or update a rule. The default value is true. This property is ignored if the ShowToolBar is set to false. Value of this property has no effect on rule evaluation.
RuleResolver
Type: CodeEffects.Rule.Common.Models.GetRuleDelegate
Delegate used to request missing rules — rules that are referenced but not included in the current rule set. This property is optional.
In some cases, such as rules that use reference-typed collections and arrays, the editor creates separate rule nodes in RuleXML for each referenced collection because its ElementType is essentially another source object for the rule. Those rule nodes are included in the resulting RuleXML of the main rule, so the RuleResolver delegate is not needed in that scenario.
However, if, for instance, you use the reusable rules feature and do not manually add to the main Rule XML all reusable rules referenced by the main rule before loading it into the editor, you need a RuleResolver delegate. The editor calls this delegate whenever it needs a referenced reusable rule, allowing your code to query rule storage and return the requested rule.
ShowDescriptionsOnMouseHover
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should display descriptions of rule actions, fields, in-rule methods, parameters of actions or in-rule methods, and reusable rules when the rule author hovers the mouse pointer over those elements in the Rule Area.
Element descriptions are optional and can be defined using the Description property of the ActionAttribute, FieldAttribute, MethodAttribute, or ParameterAttribute.
The default value is true. The value of this property has no effect on rule evaluation.
ShowHelpString
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should display the Help String located between the Toolbar and the Rule Area. The default value is true. The value of this property has no effect on rule evaluation.
ShowLineDots
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should display a • character before each new line in the Rule Area. The default value is false. The value of this property has no effect on rule evaluation.
-
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should display the related context menu when the rule author clicks elements of the current rule. If set to true, this property allows rule authors to edit rule values and modify fields, actions, operators, and other rule elements on the fly by clicking an element and selecting a replacement value from the context menu. If no suitable items are available, the Rule Editor displays the menu for the next applicable element (if any). The default value is true. The value of this property has no effect on rule evaluation.
-
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should display a context menu listing the next possible rule elements each time the rule author presses the Right Arrow key while navigating the current rule using the keyboard. When set to true, this property eliminates the need to press the Spacebar to open the menu whenever a new rule element needs to be inserted. The default value is true. The value of this property has no effect on rule evaluation.
SourceLabelsXml
Type: System.Xml.XmlDocument
Gets or sets the source labels document: the display names and descriptions of the source object's fields, in-rule methods, actions, parameters and enumeration values in another language. Each label names its member by identity, never by its display name: a field by its property path, a method or action by its name and parameters, an enumeration value by its type and number. The editor shows the labels wherever people read the source (the menus, the rule's text, the descriptions and the Help String), while the Rule XML keeps naming members by their declared names, so a rule saved in one language opens in any other. A member the document leaves out keeps the source's own name. It takes precedence over SourceLabelsXmlFile.
Get a document to translate from Xml.GetSourceLabelsDocument(..). For more information, see the Help XML and Multilingual Support topic.
SourceLabelsXmlFile
Type: System.String
Gets or sets the full physical path to the file that holds the source labels document. It is ignored when SourceLabelsXml is set. A file that is not well-formed XML throws a MalformedXmlException with the control number CE10261.
-
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should display its Toolbar. The default value is true. Setting this property to false also sets RuleNameIsRequired to false, because a rule cannot be named without the Toolbar. The value of this property has no effect on rule evaluation.
SourceAssembly
Type: System.String
Deprecated. This property is obsolete and will be removed in a future major version. Instead, use the SourceTypeName property and set it to the source object's AssemblyQualifiedName. The getter always returns null.
SourceProvider
Type: CodeEffects.Rule.Editor.Models.ISourceProvider
Gets or sets the provider the editor lists the elements of an Adaptive Source from: the fields, in-rule methods, setters, actions, reusable rules, enumerations, and data sources of the source object. Setting it to a provider switches the editor to the Adaptive Source model, and the editor then ignores SourceType, SourceTypeName, SourceXml, SourceXmlFile, ContextMenuRules, and InlineRules. Setting it to null switches the model back. The default value is null.
var editor = new Control("divEditor");
editor.SourceProvider = new MySourceProvider();
SourceType
Type: System.Type
Gets or sets the type of the source object. This property is required in Reflection and FlexSource source models and optional in Adaptive Source if no value is set for any of the SourceXml, SourceTypeName, or SourceXmlFile properties.
private Control GetEditor()
{
var ce = new Control("divClientEditorContainerId");
ce.SourceType = typeof(MySourceObject);
ce.EvaluationMode = CodeEffects.Rule.Common.Models.EvaluationMode.Execution;
ce.ShowHelpString = true;
ce.ShowToolBar = true;
ce.ShowLineDots = true;
return ce;
}
SourceTypeName
Type: System.String
Gets or sets the assembly-qualified name of the source object type. This property is required in Reflection and FlexSource source models and optional in Adaptive Source if no value is set for any of the SourceXml, SourceType, or SourceXmlFile properties. You can obtain the assembly-qualified name of the source object type by executing:
sourceObjectInstance.GetType().AssemblyQualifiedName;
SourceXml
Type: System.Xml.XmlDocument
Gets or sets the XmlDocument that defines the structure of the source object. In Code Effects, this document is referred to as Source XML. You can obtain the string representation of the Source XML at any time by calling the GetSourceXml() method of the instance of the Control class.
SourceXmlFile
Type: System.String
Gets or sets the full path to the custom XML file that defines the source object. In Code Effects, this document is referred to as Source XML. You can obtain the string representation of the Source XML at any time by calling the GetSourceXml() method of the instance of the Control class and use it as a template for source object customization in dynamic scenarios.
-
Type: System.Collections.Generic.ICollection<MenuItem>
Gets or sets the collection of existing rules that can be added to the Rules menu of the Toolbar, if it is displayed. Adding rules to the Rules menu allows rule authors to select, load, edit, or delete existing rules directly within the Rule Editor. It is up to the developer to determine which rules, if any, should be included in this collection. This property is ignored if the ShowToolBar property is set to false. The default value is null.

TypeResolver
Type: CodeEffects.Rule.Common.Models.GetTypeDelegate
Gets or sets the delegate used to resolve .NET types by their assembly-qualified or alias names in the editor and during rule evaluation. Assign this property when your application uses custom type aliases or requires custom type resolution logic. This property is optional. See the main Type Handling and Aliasing article for details.
UseHighestZindex
Type: System.Boolean
Gets or sets a value indicating whether the Rule Editor should calculate and apply the highest zIndex for its pop-up elements such as menus, date pickers, and similar controls. Set this property to true only if your script dynamically adds other DOM elements that could potentially obscure the editor’s controls and menus. The default value is false.