CSLA .NET 10.0.0
A home for your business logic
Loading...
Searching...
No Matches
Csla.Rules.BusinessRuleBase Class Referenceabstract

Base class used to create business and validation rules. More...

Inheritance diagram for Csla.Rules.BusinessRuleBase:
Csla.Rules.IBusinessRuleBase Csla.Rules.BusinessRule Csla.Rules.BusinessRuleAsync Csla.Rules.CommonRules.DataAnnotation Csla.Rules.CommonRules.Dependency Csla.Rules.CommonRules.InfoMessage Csla.Rules.CommonRules.Lambda Csla.Rules.ObjectRule Csla.Rules.PropertyRule Csla.Rules.ObjectRuleAsync Csla.Rules.PropertyRuleAsync

Protected Member Functions

void CanWriteProperty (string argument)
 Allows or blocks changing a property value.
 BusinessRuleBase (IPropertyInfo? primaryProperty)
 Creates an instance of the rule that applies to a specfic property.
void LoadProperty (object obj, IPropertyInfo propertyInfo, object? newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change.
object? ReadProperty (object obj, IPropertyInfo propertyInfo)
 Reads a property's field value.

Properties

bool CascadeIfDirty [get, protected set]
 If true, rule will only cascade if the primary property is dirty.
bool PropertiesLocked [get, set]
 Gets or sets a value indicating whether property values should be locked because an async operation is running.
virtual ? IPropertyInfo PrimaryProperty [get, set]
 Gets or sets the primary property affected by this rule.
List< IPropertyInfoAffectedProperties [get]
 Gets a list of properties affected by this rule. Rules for these properties are executed after rules for the primary property.
List< IPropertyInfoInputProperties [get]
 Gets a list of secondary property values to be supplied to the rule when it is executed.
bool IsAsync [get, protected set]
 Gets a value indicating whether the rule will run on a background thread.
bool ProvideTargetWhenAsync [get, protected set]
 Gets a value indicating that the Target property should be set even for an async rule (note that using Target from a background thread will cause major problems).
string RuleName [get]
 Gets a unique rule:// URI for the specific instance of the rule within the context of the business object where the rule is used.
RuleUri RuleUri [get, set]
 Sets or gets the rule:// URI object for this rule.
int Priority [get, set]
 Gets the rule priority.
RunModes RunMode [get, set]
 Gets or sets the run in context.
int DisplayIndex [get, set]
 Gets the rule DisplayIndex in UI.

Detailed Description

Base class used to create business and validation rules.

Constructor & Destructor Documentation

◆ BusinessRuleBase()

Csla.Rules.BusinessRuleBase.BusinessRuleBase ( IPropertyInfo? primaryProperty)
inlineprotected

Creates an instance of the rule that applies to a specfic property.

Parameters
primaryPropertyPrimary property for this rule.

Member Function Documentation

◆ CanWriteProperty()

void Csla.Rules.BusinessRuleBase.CanWriteProperty ( string argument)
inlineprotected

Allows or blocks changing a property value.

Parameters
argument

◆ LoadProperty()

void Csla.Rules.BusinessRuleBase.LoadProperty ( object obj,
IPropertyInfo propertyInfo,
object? newValue )
inlineprotected

Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change.

Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.
newValueThe new value for the property.

No authorization checks occur when this method is called, and no PropertyChanging or PropertyChanged events are raised. Loading values does not cause validation rules to be invoked.

Exceptions
ArgumentNullExceptionobj or propertyInfo is null.

◆ ReadProperty()

object? Csla.Rules.BusinessRuleBase.ReadProperty ( object obj,
IPropertyInfo propertyInfo )
inlineprotected

Reads a property's field value.

Parameters
objObject on which to call the method.
propertyInfoPropertyInfo object containing property metadata.

No authorization checks occur when this method is called.

Exceptions
ArgumentNullExceptionobj or propertyInfo is null.

Property Documentation

◆ AffectedProperties

List<IPropertyInfo> Csla.Rules.BusinessRuleBase.AffectedProperties
get

Gets a list of properties affected by this rule. Rules for these properties are executed after rules for the primary property.

Implements Csla.Rules.IBusinessRuleBase.

◆ CascadeIfDirty

bool Csla.Rules.BusinessRuleBase.CascadeIfDirty
getprotected set

If true, rule will only cascade if the primary property is dirty.

Implements Csla.Rules.IBusinessRuleBase.

◆ DisplayIndex

int Csla.Rules.BusinessRuleBase.DisplayIndex
getset

Gets the rule DisplayIndex in UI.

Implements Csla.Rules.IBusinessRuleBase.

◆ InputProperties

List<IPropertyInfo> Csla.Rules.BusinessRuleBase.InputProperties
get

Gets a list of secondary property values to be supplied to the rule when it is executed.

Implements Csla.Rules.IBusinessRuleBase.

◆ IsAsync

bool Csla.Rules.BusinessRuleBase.IsAsync
getprotected setabstract

Gets a value indicating whether the rule will run on a background thread.

Implements Csla.Rules.IBusinessRuleBase.

◆ PrimaryProperty

virtual ? IPropertyInfo Csla.Rules.BusinessRuleBase.PrimaryProperty
getset

Gets or sets the primary property affected by this rule.

Implements Csla.Rules.IBusinessRuleBase.

◆ Priority

int Csla.Rules.BusinessRuleBase.Priority
getset

Gets the rule priority.

Implements Csla.Rules.IBusinessRuleBase.

◆ PropertiesLocked

bool Csla.Rules.BusinessRuleBase.PropertiesLocked
getsetprotected

Gets or sets a value indicating whether property values should be locked because an async operation is running.

◆ ProvideTargetWhenAsync

bool Csla.Rules.BusinessRuleBase.ProvideTargetWhenAsync
getprotected set

Gets a value indicating that the Target property should be set even for an async rule (note that using Target from a background thread will cause major problems).

Implements Csla.Rules.IBusinessRuleBase.

◆ RuleName

string Csla.Rules.BusinessRuleBase.RuleName
get

Gets a unique rule:// URI for the specific instance of the rule within the context of the business object where the rule is used.

Implements Csla.Rules.IBusinessRuleBase.

◆ RuleUri

RuleUri Csla.Rules.BusinessRuleBase.RuleUri
getsetprotected

Sets or gets the rule:// URI object for this rule.

Exceptions
ArgumentNullExceptionvalue is null.

◆ RunMode

RunModes Csla.Rules.BusinessRuleBase.RunMode
getset

Gets or sets the run in context.

The run in context.

Implements Csla.Rules.IBusinessRuleBase.


The documentation for this class was generated from the following file: