CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Validation.RuleArgs Class Reference

Object providing extra information to methods that implement business rules. More...

Inheritance diagram for Csla.Validation.RuleArgs:
Csla.Validation.CommonRules.DataAnnotationRuleArgs Csla.Validation.DecoratedRuleArgs Csla.Validation.CommonRules.IntegerMaxValueRuleArgs Csla.Validation.CommonRules.IntegerMinValueRuleArgs Csla.Validation.CommonRules.MaxLengthRuleArgs Csla.Validation.CommonRules.MaxValueRuleArgs< T > Csla.Validation.CommonRules.MinLengthRuleArgs Csla.Validation.CommonRules.MinValueRuleArgs< T > Csla.Validation.CommonRules.RegExRuleArgs

Public Member Functions

 RuleArgs (string propertyName)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (Core.IPropertyInfo propertyInfo)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (string propertyName, string friendlyName)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (string propertyName, RuleSeverity severity)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (Core.IPropertyInfo propertyInfo, RuleSeverity severity)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (string propertyName, string friendlyName, RuleSeverity severity)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (string propertyName, RuleSeverity severity, bool stopProcessing)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (Core.IPropertyInfo propertyInfo, RuleSeverity severity, bool stopProcessing)
 Creates an instance of RuleArgs. More...
 
 RuleArgs (string propertyName, string friendlyName, RuleSeverity severity, bool stopProcessing)
 Creates an instance of RuleArgs. More...
 
override string ToString ()
 Returns a string representation of the object. More...
 

Static Public Member Functions

static string GetPropertyName (RuleArgs e)
 Gets the property name from the RuleArgs object, using the friendly name if one is defined. More...
 

Properties

string PropertyName [get]
 The name of the property to be validated. More...
 
string PropertyFriendlyName [getset]
 Gets or sets a friendly name for the property, which will be used in place of the property name when creating the broken rule description string. More...
 
string Description [getset]
 Set by the rule handler method to describe the broken rule. More...
 
RuleSeverity Severity [getset]
 Gets or sets the severity of the broken rule. More...
 
bool StopProcessing [getset]
 Gets or sets a value indicating whether this broken rule should stop the processing of subsequent rules for this property. More...
 

Detailed Description

Object providing extra information to methods that implement business rules.

As imlemented in Csla 3.8.x so older style rules will compile.

Definition at line 21 of file RuleArgs.cs.

Constructor & Destructor Documentation

◆ RuleArgs() [1/9]

Csla.Validation.RuleArgs.RuleArgs ( string  propertyName)

Creates an instance of RuleArgs.

Parameters
propertyNameThe name of the property to be validated.

Definition at line 102 of file RuleArgs.cs.

◆ RuleArgs() [2/9]

Csla.Validation.RuleArgs.RuleArgs ( Core.IPropertyInfo  propertyInfo)

Creates an instance of RuleArgs.

Parameters
propertyInfoThe PropertyInfo object for the property.

Definition at line 113 of file RuleArgs.cs.

◆ RuleArgs() [3/9]

Csla.Validation.RuleArgs.RuleArgs ( string  propertyName,
string  friendlyName 
)

Creates an instance of RuleArgs.

Parameters
propertyNameThe name of the property to be validated.
friendlyNameA friendly name for the property, which will be used in place of the property name when creating the broken rule description string.

Definition at line 126 of file RuleArgs.cs.

◆ RuleArgs() [4/9]

Csla.Validation.RuleArgs.RuleArgs ( string  propertyName,
RuleSeverity  severity 
)

Creates an instance of RuleArgs.

Parameters
propertyNameThe name of the property to be validated.
severityInitial default severity for the rule.

The severity parameter defines only the initial default severity value. If the rule changes this value by setting e.Severity, then that new value will become the default for all subsequent rule invocations.

To avoid confusion, it is recommended that the severity constructor parameter only be used for rule methods that do not explicitly set e.Severity.

Definition at line 150 of file RuleArgs.cs.

◆ RuleArgs() [5/9]

Csla.Validation.RuleArgs.RuleArgs ( Core.IPropertyInfo  propertyInfo,
RuleSeverity  severity 
)

Creates an instance of RuleArgs.

Parameters
propertyInfoThe PropertyInfo for the property.
severityInitial default severity for the rule.

The severity parameter defines only the initial default severity value. If the rule changes this value by setting e.Severity, then that new value will become the default for all subsequent rule invocations.

To avoid confusion, it is recommended that the severity constructor parameter only be used for rule methods that do not explicitly set e.Severity.

Definition at line 174 of file RuleArgs.cs.

◆ RuleArgs() [6/9]

Csla.Validation.RuleArgs.RuleArgs ( string  propertyName,
string  friendlyName,
RuleSeverity  severity 
)

Creates an instance of RuleArgs.

Parameters
propertyNameThe name of the property to be validated.
friendlyNameA friendly name for the property, which will be used in place of the property name when creating the broken rule description string.
severityInitial default severity for the rule.

The severity parameter defines only the initial default severity value. If the rule changes this value by setting e.Severity, then that new value will become the default for all subsequent rule invocations.

To avoid confusion, it is recommended that the severity constructor parameter only be used for rule methods that do not explicitly set e.Severity.

Definition at line 201 of file RuleArgs.cs.

◆ RuleArgs() [7/9]

Csla.Validation.RuleArgs.RuleArgs ( string  propertyName,
RuleSeverity  severity,
bool  stopProcessing 
)

Creates an instance of RuleArgs.

Parameters
propertyNameThe name of the property to be validated.
severityThe default severity for the rule.
stopProcessingInitial default value for the StopProcessing property.

The severity and stopProcessing parameters define only the initial default values. If the rule changes these values by setting e.Severity or e.StopProcessing, then the new values will become the default for all subsequent rule invocations.

To avoid confusion, It is recommended that the severity and stopProcessing constructor parameters only be used for rule methods that do not explicitly set e.Severity or e.StopProcessing.

Definition at line 229 of file RuleArgs.cs.

◆ RuleArgs() [8/9]

Csla.Validation.RuleArgs.RuleArgs ( Core.IPropertyInfo  propertyInfo,
RuleSeverity  severity,
bool  stopProcessing 
)

Creates an instance of RuleArgs.

Parameters
propertyInfoThe PropertyInfo for the property.
severityThe default severity for the rule.
stopProcessingInitial default value for the StopProcessing property.

The severity and stopProcessing parameters define only the initial default values. If the rule changes these values by setting e.Severity or e.StopProcessing, then the new values will become the default for all subsequent rule invocations.

To avoid confusion, It is recommended that the severity and stopProcessing constructor parameters only be used for rule methods that do not explicitly set e.Severity or e.StopProcessing.

Definition at line 257 of file RuleArgs.cs.

◆ RuleArgs() [9/9]

Csla.Validation.RuleArgs.RuleArgs ( string  propertyName,
string  friendlyName,
RuleSeverity  severity,
bool  stopProcessing 
)

Creates an instance of RuleArgs.

Parameters
propertyNameThe name of the property to be validated.
friendlyNameA friendly name for the property, which will be used in place of the property name when creating the broken rule description string.
severityThe default severity for the rule.
stopProcessingInitial default value for the StopProcessing property.

The severity and stopProcessing parameters define only the initial default values. If the rule changes these values by setting e.Severity or e.StopProcessing, then the new values will become the default for all subsequent rule invocations.

To avoid confusion, It is recommended that the severity and stopProcessing constructor parameters only be used for rule methods that do not explicitly set e.Severity or e.StopProcessing.

Definition at line 288 of file RuleArgs.cs.

Member Function Documentation

◆ GetPropertyName()

static string Csla.Validation.RuleArgs.GetPropertyName ( RuleArgs  e)
static

Gets the property name from the RuleArgs object, using the friendly name if one is defined.

Parameters
eObject from which to extract the name.
Returns
The friendly property name if it exists, otherwise the property name itself.

Definition at line 313 of file RuleArgs.cs.

◆ ToString()

override string Csla.Validation.RuleArgs.ToString ( )

Returns a string representation of the object.

Definition at line 297 of file RuleArgs.cs.

Property Documentation

◆ Description

string Csla.Validation.RuleArgs.Description
getset

Set by the rule handler method to describe the broken rule.

A human-readable description of the broken rule.

Setting this property only has an effect if the rule method returns false.

Definition at line 58 of file RuleArgs.cs.

◆ PropertyFriendlyName

string Csla.Validation.RuleArgs.PropertyFriendlyName
getset

Gets or sets a friendly name for the property, which will be used in place of the property name when creating the broken rule description string.

Definition at line 42 of file RuleArgs.cs.

◆ PropertyName

string Csla.Validation.RuleArgs.PropertyName
get

The name of the property to be validated.

Definition at line 32 of file RuleArgs.cs.

◆ Severity

RuleSeverity Csla.Validation.RuleArgs.Severity
getset

Gets or sets the severity of the broken rule.

The severity of the broken rule.

Setting this property only has an effect if the rule method returns false.

Definition at line 74 of file RuleArgs.cs.

◆ StopProcessing

bool Csla.Validation.RuleArgs.StopProcessing
getset

Gets or sets a value indicating whether this broken rule should stop the processing of subsequent rules for this property.

true if no further rules should be process for this property.

Setting this property only has an effect if the rule method returns false.

Definition at line 91 of file RuleArgs.cs.