ISourceElements Interface
Assembly: CodeEffects.Rule.Editor.dll
Namespace: CodeEffects.Rule.Editor.Models
Summary
Holds the source elements an ISourceProvider offers at one point in a rule: the fields and in-rule methods of a condition, or the setters and actions of an execution. It is a subset of the source, chosen by context. The whole source is a Source.
Syntax
public interface ISourceElements
Properties
CacheID
Type: System.String
Gets or sets the ID the editor caches this set of elements under on the client. Give the same ID to the same set of elements so the editor does not request it again.
Fields
Type: System.Collections.Generic.ICollection<CodeEffects.Rule.Editor.Client.Field>
Gets or sets the fields in this set. In the set returned by GetSettersAndActions, these are the setters.
Functions
Type: System.Collections.Generic.ICollection<CodeEffects.Rule.Editor.Client.Function>
Gets or sets the in-rule methods in this set. In the set returned by GetSettersAndActions, these are the actions.
Example
public class SourceElements : ISourceElements
{
public string CacheID { get; set; }
public ICollection<Field> Fields { get; set; } = new List<Field>();
public ICollection<Function> Functions { get; set; } = new List<Function>();
}
var elements = new SourceElements { CacheID = "conditions" };
elements.Fields.Add(new Field { Value = "MySource.UserID", DisplayName = "User ID" });