DataAttribute Class
Assembly: CodeEffects.Rule.Common.dll
Namespace: CodeEffects.Rule.Common.Attributes
Summary
Defines a single reusable Dynamic Menu Data Source on a source object level.
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)]
public class DataAttribute : System.Attribute
Properties
Assembly
Type: System.String
Gets or sets the fully qualified name of the assembly that contains the class declaring the data source method. For server-side methods, this property and the TypeName
property are required if the Type
property is not set. You can obtain this name by executing Assembly.GetAssembly(declaringClassType).FullName
.
Method
Type: System.String
Gets or sets the name of the method that provides the menu data source. This property is required. On the server, this must be a public parameterless method that returns an ICollection<DataSourceItem>
. On the client, the function must be parameterless and return an array of anonymous objects in the following format:
{ ID: "Item string ID", Name: "Item string name" }
Name
Type: System.String
Gets or sets the unique name of the data source, which can be used to distinguish this menu data source from all other menu data sources within the same source object. You can think of this property as a data source identifier that is unique only within the current source object. The uniqueness of each name must be ensured by the developer; Rule Editor does not enforce it. This property is required.
Type
Type: System.Type
Gets or sets the type of the class that declares the data source method. For server-side methods, this property is required if the Assembly
and TypeName
properties are not specified.
TypeName
Type: System.String
Gets or sets the full type name of the class that declares the data source method. For server-side methods, this property and the Assembly
property are required if the Type
property is not specified. You can obtain this name by executing typeof(ClassName).FullName
.
Remarks
Rule Editor can use any qualified .NET methods or any accessible client-side functions as menu data sources. If a constructor without type references is used, Rule Editor assumes that the data source is a client function.