|
SourceAttribute class
Namespace: CodeEffects.Rule.Attributes
Assembly: CodeEffects.Rule.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class SourceAttribute : System.Attribute
When applied to a public class, marks this class as a source object. Source objects are a cornerstone element of Web Rule. See the source object topic for details.
Properties
-
DeclaredMembersOnly
Type: System.Boolean
Gets or sets the value indicating whether Web Rule should only use public members declared by the source object and disregard members of its base class(es). The default value is False. Notice that members of the System.Object class are ignored by Web Rule regardless of the value of this property. This property plays an important role in the technique of preserving attributes in auto-generated classes technique.
-
MaxTypeNestingLevel
Type: System.Int32
Web Rule performs a recursive search of all reference type members of the source object and includes all their value type members not decorated with ExcludeFromEvaluationAttribute as rule fields. The recursive search for value type members is performed up to the level set by this optional property. The default value is 4. Setting the MaxTypeNestingLevel to a higher number may slow down the performance of Web Rule while it renders itself on a page.
-
PersistTypeNameInRuleXml
Type: System.Boolean
Gets or sets the value indicating whether Web Rule should store the name of the source object's type in the Rule XML. The default value is True. Set the value of this property to False if you generate source objects dynamically and don't know their types at design time.
Example
using CodeEffects.Rule.Attributes;
namespace TestLibrary
{
[Source(MaxTypeNestingLevel = 2)]
public class Test
{
}
}
|