DataAttribute class

Namespace: CodeEffects.Rule.Attributes
Assemblies:
CodeEffects.Rule.Editor.Asp.dll
CodeEffects.Rule.Editor.Mvc.dll
CodeEffects.Rule.Editor.Core.dll
CodeEffects.Rule.Editor.Net.dll

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 : Attribute

Properties

  • Assembly Type: System.String

    Gets or sets the qualified name of the assembly of the class that declares the data source method. For server-side methods, this and the TypeName properties are required if Type property is not set. You can get 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. On the server, this should be a public parameterless method that returns ICollection<DataSourceItem>. On the client, the function is expected to be parameterless and returns an array of anonymous objects of the following notation: { ID: "Item string ID", Name: "Item string name" }.

  • Name Type: System.String

    Gets or sets the unique name of the data source that can be used to distinguish this source from all other data sources within the same source object. Think of this property as a data source ID that is unique only for the current source object. The uniqueness of each name should be verified by the developer; Rule Editor does not enforce it.

  • 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 set.

  • 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 and the Assembly properties are required if the Type property is not set. You can get this name by executing typeof(ClassName)

IMPORTANT! Rule Editor can use any qualified .NET methods or any accessible client-side functions as a menu data source. If a constructor that doesn't take any type references is used, Rule Editor will assume that the data source is a client function.

The Dynamic Menu Data Sources is an important feature of Code Effects. Details on the use of the DataAttribute as well as details on the feature itself are provided in the feature topic.

This attribute is optional.

Comments: 0
Post your questions about Code Effects on Stackoverflow.com
and become a part of our growing community
Name (optional):
Comment (URLs are allowed and must start with http:// or https://; all tags will be encoded):
Remaining character count: