Context information provided to a business rule when it is invoked. More...
Public Member Functions | |
void | ExecuteRule (IBusinessRuleBase innerRule) |
Executes the inner rule from the outer rules context. More... | |
RuleContext (ApplicationContext applicationContext, Action< IRuleContext > completeHandler, IBusinessRuleBase rule, object target, Dictionary< Csla.Core.IPropertyInfo, object > inputPropertyValues) | |
Creates a RuleContext instance for unit tests. More... | |
IRuleContext | GetChainedContext (IBusinessRuleBase rule) |
Gets a new RuleContext object for a chained rule. More... | |
void | AddErrorResult (string description) |
Add a Error severity result to the Results list. More... | |
void | AddErrorResult (string description, bool stopProcessing) |
Add a Error severity result to the Results list. More... | |
void | AddErrorResult (Csla.Core.IPropertyInfo property, string description) |
Add a Error severity result to the Results list. More... | |
void | AddWarningResult (string description) |
Add a Warning severity result to the Results list. More... | |
void | AddWarningResult (string description, bool stopProcessing) |
Add a Warning severity result to the Results list. More... | |
void | AddWarningResult (Csla.Core.IPropertyInfo property, string description) |
Add a Warning severity result to the Results list. More... | |
void | AddInformationResult (string description) |
Add an Information severity result to the Results list. More... | |
void | AddInformationResult (string description, bool stopProcessing) |
Add an Information severity result to the Results list. More... | |
void | AddInformationResult (Csla.Core.IPropertyInfo property, string description) |
Add an Information severity result to the Results list. More... | |
void | AddSuccessResult (bool stopProcessing) |
Add a Success severity result to the Results list. More... | |
void | AddOutValue (object value) |
Add an outbound value to update the rule's primary property on the business object once the rule is complete. More... | |
void | AddOutValue (Csla.Core.IPropertyInfo property, object value) |
Add an outbound value to update a property on the business object once the rule is complete. More... | |
void | AddDirtyProperty (Csla.Core.IPropertyInfo property) |
Adds a property name as a dirty field (changed value). More... | |
void | Complete () |
Indicates that the rule processing is complete, so CSLA .NET will process the Results list. More... | |
T | GetInputValue< T > (PropertyInfo< T > propertyInfo) |
Gets the value. More... | |
T | GetInputValue< T > (IPropertyInfo propertyInfo) |
Gets the value with explicit cast More... | |
bool | TryGetInputValue< T > (PropertyInfo< T > propertyInfo, ref T value) |
Tries to get the value. More... | |
bool | TryGetInputValue< T > (IPropertyInfo propertyInfo, ref T value) |
Tries to get the value with explicit cast. More... | |
Properties | |
IBusinessRuleBase | Rule [getset] |
Gets the rule object. More... | |
object | Target [getset] |
Gets a reference to the target business object. More... | |
Dictionary< Csla.Core.IPropertyInfo, object > | InputPropertyValues [getset] |
Gets a dictionary containing copies of property values from the target business object. More... | |
List< IPropertyInfo > | DirtyProperties [get] |
Gets a list of dirty properties (value was updated). More... | |
Dictionary< Csla.Core.IPropertyInfo, object > | OutputPropertyValues [get] |
Gets a dictionary containing copies of property values that should be updated in the target object. More... | |
List< RuleResult > | Results [get] |
Gets a list of RuleResult objects containing the results of the rule. More... | |
string | OriginPropertyName [getset] |
Gets or sets the name of the origin property. More... | |
RuleContextModes | ExecuteContext [getset] |
Gets the execution context. More... | |
bool | IsCascadeContext [get] |
Gets a value indicating whether this instance is cascade context as a result of AffectedProperties. More... | |
bool | IsPropertyChangedContext [get] |
Gets a value indicating whether this instance is property changed context. More... | |
bool | IsCheckRulesContext [get] |
Gets a value indicating whether this instance is check rules context. More... | |
bool | IsCheckObjectRulesContext [get] |
Gets a value indicating whether this instance is check object rules context. More... | |
ApplicationContext | ApplicationContext [get] |
Gets a reference to the current ApplicationContext. More... | |
IDataPortalFactory | DataPortalFactory [get] |
Gets a data portal factory instance More... | |
Properties inherited from Csla.Rules.IRuleContext | |
IBusinessRuleBase | Rule [get] |
Gets the rule object. More... | |
object | Target [get] |
Gets a reference to the target business object. More... | |
Dictionary< Csla.Core.IPropertyInfo, object > | InputPropertyValues [get] |
Gets a dictionary containing copies of property values from the target business object. More... | |
List< IPropertyInfo > | DirtyProperties [get] |
Gets a list of dirty properties (value was updated). More... | |
Dictionary< Csla.Core.IPropertyInfo, object > | OutputPropertyValues [get] |
Gets a dictionary containing copies of property values that should be updated in the target object. More... | |
List< RuleResult > | Results [get] |
Gets a list of RuleResult objects containing the results of the rule. More... | |
string | OriginPropertyName [get] |
Gets or sets the name of the origin property. More... | |
bool | IsCascadeContext [get] |
Gets a value indicating whether this instance is cascade context as a result of AffectedProperties. More... | |
bool | IsPropertyChangedContext [get] |
Gets a value indicating whether this instance is property changed context. More... | |
bool | IsCheckRulesContext [get] |
Gets a value indicating whether this instance is check rules context. More... | |
bool | IsCheckObjectRulesContext [get] |
Gets a value indicating whether this instance is check object rules context. More... | |
RuleContextModes | ExecuteContext [get] |
Gets the execution context. More... | |
ApplicationContext | ApplicationContext [get] |
Gets a reference to the current ApplicationContext. More... | |
IDataPortalFactory | DataPortalFactory [get] |
Gets a data portal factory instance More... | |
Context information provided to a business rule when it is invoked.
Definition at line 50 of file RuleContext.cs.
Csla.Rules.RuleContext.RuleContext | ( | ApplicationContext | applicationContext, |
Action< IRuleContext > | completeHandler, | ||
IBusinessRuleBase | rule, | ||
object | target, | ||
Dictionary< Csla.Core.IPropertyInfo, object > | inputPropertyValues | ||
) |
Creates a RuleContext instance for unit tests.
applicationContext | Current ApplicationContext |
completeHandler | Callback for async rule. |
rule | Reference to the rule object. |
target | Target business object. |
inputPropertyValues | Input property values used by the rule. |
Definition at line 243 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddDirtyProperty | ( | Csla.Core.IPropertyInfo | property | ) |
Adds a property name as a dirty field (changed value).
property | The property. |
System.ArgumentOutOfRangeException |
Implements Csla.Rules.IRuleContext.
Definition at line 424 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddErrorResult | ( | Csla.Core.IPropertyInfo | property, |
string | description | ||
) |
Add a Error severity result to the Results list.
This method is only allowed on "object" level rules to allow an object level rule to set warning result on a field.
property | Property to which the result applies. |
description | Human-readable description of why the rule failed. |
System.ArgumentOutOfRangeException | When property is not defined in AffectedProperties list. |
Implements Csla.Rules.IRuleContext.
Definition at line 308 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddErrorResult | ( | string | description | ) |
Add a Error severity result to the Results list.
description | Human-readable description of why the rule failed. |
Implements Csla.Rules.IRuleContext.
Definition at line 283 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddErrorResult | ( | string | description, |
bool | stopProcessing | ||
) |
Add a Error severity result to the Results list.
description | Human-readable description of why the rule failed. |
stopProcessing | True if no further rules should be processed for the current property. |
Implements Csla.Rules.IRuleContext.
Definition at line 295 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddInformationResult | ( | Csla.Core.IPropertyInfo | property, |
string | description | ||
) |
Add an Information severity result to the Results list.
This method is only allowed on "object" level rules to allow an object level rule to set warning result on a field.
property | Property to which the result applies. |
description | Human-readable description of why the rule failed. |
System.ArgumentOutOfRangeException | When property is not defined in AffectedProperties list. |
Implements Csla.Rules.IRuleContext.
Definition at line 379 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddInformationResult | ( | string | description | ) |
Add an Information severity result to the Results list.
description | Human-readable description of why the rule failed. |
Implements Csla.Rules.IRuleContext.
Definition at line 357 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddInformationResult | ( | string | description, |
bool | stopProcessing | ||
) |
Add an Information severity result to the Results list.
description | Human-readable description of why the rule failed. |
stopProcessing | True if no further rules should be processed for the current property. |
Implements Csla.Rules.IRuleContext.
Definition at line 367 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddOutValue | ( | Csla.Core.IPropertyInfo | property, |
object | value | ||
) |
Add an outbound value to update a property on the business object once the rule is complete.
property | Property to update. |
value | New property value. |
System.ArgumentOutOfRangeException | When property is not defined in AffectedProperties list. |
Implements Csla.Rules.IRuleContext.
Definition at line 412 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddOutValue | ( | object | value | ) |
Add an outbound value to update the rule's primary property on the business object once the rule is complete.
value | New property value. |
Implements Csla.Rules.IRuleContext.
Definition at line 400 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddSuccessResult | ( | bool | stopProcessing | ) |
Add a Success severity result to the Results list.
stopProcessing | True if no further rules should be processed for the current property. |
Implements Csla.Rules.IRuleContext.
Definition at line 390 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddWarningResult | ( | Csla.Core.IPropertyInfo | property, |
string | description | ||
) |
Add a Warning severity result to the Results list.
This method is only allowed on "object" level rules to allow an object level rule to set warning result on a field.
property | Property to which the result applies. |
description | Human-readable description of why the rule failed. |
System.ArgumentOutOfRangeException | When property is not defined in AffectedProperties list. |
Implements Csla.Rules.IRuleContext.
Definition at line 345 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddWarningResult | ( | string | description | ) |
Add a Warning severity result to the Results list.
description | Human-readable description of why the rule failed. |
Implements Csla.Rules.IRuleContext.
Definition at line 320 of file RuleContext.cs.
void Csla.Rules.RuleContext.AddWarningResult | ( | string | description, |
bool | stopProcessing | ||
) |
Add a Warning severity result to the Results list.
description | Human-readable description of why the rule failed. |
stopProcessing | True if no further rules should be processed for the current property. |
Implements Csla.Rules.IRuleContext.
Definition at line 332 of file RuleContext.cs.
void Csla.Rules.RuleContext.Complete | ( | ) |
Indicates that the rule processing is complete, so CSLA .NET will process the Results list.
This method must be invoked on the UI thread.
Implements Csla.Rules.IRuleContext.
Definition at line 436 of file RuleContext.cs.
void Csla.Rules.RuleContext.ExecuteRule | ( | IBusinessRuleBase | innerRule | ) |
Executes the inner rule from the outer rules context.
Creates a chained context and if CanRunRule will execute the inner rule.
innerRule | The inner rule. |
Implements Csla.Rules.IRuleContext.
Definition at line 148 of file RuleContext.cs.
IRuleContext Csla.Rules.RuleContext.GetChainedContext | ( | IBusinessRuleBase | rule | ) |
Gets a new RuleContext object for a chained rule.
rule | Chained rule that will use this new context. |
The properties from the existing RuleContext will be used to create the new context, with the exception of the Rule property which is set using the supplied IBusinessRule value.
Implements Csla.Rules.IRuleContext.
Definition at line 265 of file RuleContext.cs.
T Csla.Rules.RuleContext.GetInputValue< T > | ( | IPropertyInfo | propertyInfo | ) |
Gets the value with explicit cast
T |
propertyInfo | The generic property info. |
Implements Csla.Rules.IRuleContext.
Definition at line 460 of file RuleContext.cs.
T Csla.Rules.RuleContext.GetInputValue< T > | ( | PropertyInfo< T > | propertyInfo | ) |
Gets the value.
T |
propertyInfo | The property info. |
Implements Csla.Rules.IRuleContext.
Definition at line 449 of file RuleContext.cs.
bool Csla.Rules.RuleContext.TryGetInputValue< T > | ( | IPropertyInfo | propertyInfo, |
ref T | value | ||
) |
Tries to get the value with explicit cast.
Use this method on LazyLoaded properties to test if value has been provided or not.
T |
propertyInfo | The generic property info. |
value | The value. |
Implements Csla.Rules.IRuleContext.
Definition at line 491 of file RuleContext.cs.
bool Csla.Rules.RuleContext.TryGetInputValue< T > | ( | PropertyInfo< T > | propertyInfo, |
ref T | value | ||
) |
Tries to get the value.
Use this method on LazyLoaded properties to test if value has been provided or not.
T |
propertyInfo | The generic property info. |
value | The value. |
Implements Csla.Rules.IRuleContext.
Definition at line 472 of file RuleContext.cs.
|
get |
Gets a reference to the current ApplicationContext.
Definition at line 506 of file RuleContext.cs.
|
get |
Gets a data portal factory instance
Definition at line 511 of file RuleContext.cs.
|
get |
Gets a list of dirty properties (value was updated).
The dirty properties.
Definition at line 77 of file RuleContext.cs.
|
getset |
|
getset |
Gets a dictionary containing copies of property values from the target business object.
Definition at line 67 of file RuleContext.cs.
|
get |
Gets a value indicating whether this instance is cascade context as a result of AffectedProperties.
true
if this instance is cascade context; otherwise, false
.
Definition at line 169 of file RuleContext.cs.
|
get |
Gets a value indicating whether this instance is check object rules context.
true
if this instance is check object rules context; otherwise, false
.
Definition at line 205 of file RuleContext.cs.
|
get |
Gets a value indicating whether this instance is check rules context.
true
if this instance is check rules context; otherwise, false
.
Definition at line 193 of file RuleContext.cs.
|
get |
Gets a value indicating whether this instance is property changed context.
true
if this instance is property changed context; otherwise, false
.
Definition at line 181 of file RuleContext.cs.
|
getset |
Gets or sets the name of the origin property.
The name of the origin property.
Definition at line 134 of file RuleContext.cs.
|
get |
Gets a dictionary containing copies of property values that should be updated in the target object.
Definition at line 93 of file RuleContext.cs.
|
get |
Gets a list of RuleResult objects containing the results of the rule.
Definition at line 113 of file RuleContext.cs.
|
getset |
Gets the rule object.
Definition at line 56 of file RuleContext.cs.
|
getset |
Gets a reference to the target business object.
Definition at line 61 of file RuleContext.cs.