CSLA .NET 10.0.0
A home for your business logic
Loading...
Searching...
No Matches
Csla.Rules.CommonRules.Required Class Reference

Business rule for a required string. More...

Inheritance diagram for Csla.Rules.CommonRules.Required:
Csla.Rules.CommonRules.CommonBusinessRule Csla.Rules.PropertyRule Csla.Rules.BusinessRule Csla.Rules.BusinessRuleBase Csla.Rules.IBusinessRule Csla.Rules.IBusinessRuleBase Csla.Rules.IBusinessRuleBase

Public Member Functions

 Required (Core.IPropertyInfo primaryProperty)
 Creates an instance of the rule.
 Required (Core.IPropertyInfo primaryProperty, string message)
 Creates an instance of the rule.
 Required (Core.IPropertyInfo primaryProperty, Func< string > messageDelegate)
 Creates an instance of the rule.

Protected Member Functions

override string GetMessage ()
 Gets the error message.
override void Execute (IRuleContext context)
 Rule implementation.
Protected Member Functions inherited from Csla.Rules.CommonRules.CommonBusinessRule
 CommonBusinessRule (Core.IPropertyInfo? primaryProperty)
 Creates an instance of the rule.
 CommonBusinessRule ()
 Creates an instance of the rule.
Protected Member Functions inherited from Csla.Rules.PropertyRule
 PropertyRule ()
 Initializes a new instance of the PropertyRule class.
 PropertyRule (IPropertyInfo? propertyInfo)
 Initializes a new instance of the PropertyRule class.
Protected Member Functions inherited from Csla.Rules.BusinessRule
 BusinessRule ()
 Creates an instance of the rule that applies to a business object as a whole.
 BusinessRule (Core.IPropertyInfo? primaryProperty)
 Creates an instance of the rule that applies to a specfic property.
Protected Member Functions inherited from Csla.Rules.BusinessRuleBase
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.

Additional Inherited Members

Properties inherited from Csla.Rules.CommonRules.CommonBusinessRule
RuleSeverity Severity [get, set]
 Gets or sets the severity for this rule.
Properties inherited from Csla.Rules.PropertyRule
string MessageText [get, set]
 Gets or sets the error message (constant).
Func< string >? MessageDelegate [get, set]
 Gets or sets the error message function for this rule. Use this for localizable messages from a resource file.
bool HasMessageDelegate [get]
 Gets a value indicating whether this instance has message delegate.
bool CanRunAsAffectedProperty [get, set]
 Gets or sets a value indicating whether this instance can run as affected property.
bool CanRunOnServer [get, set]
 Gets or sets a value indicating whether this instance can run in logical serverside data portal.
bool CanRunInCheckRules [get, set]
 Gets or sets a value indicating whether this instance can run when CheckRules is called on BO.
Properties inherited from Csla.Rules.BusinessRule
override bool IsAsync [get, protected set]
 Gets a value indicating whether the rule will run on a background thread.
Properties inherited from Csla.Rules.BusinessRuleBase
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

Business rule for a required string.

Constructor & Destructor Documentation

◆ Required() [1/3]

Csla.Rules.CommonRules.Required.Required ( Core.IPropertyInfo primaryProperty)
inline

Creates an instance of the rule.

Parameters
primaryPropertyProperty to which the rule applies.
Exceptions
ArgumentNullExceptionprimaryProperty is null.

◆ Required() [2/3]

Csla.Rules.CommonRules.Required.Required ( Core.IPropertyInfo primaryProperty,
string message )
inline

Creates an instance of the rule.

Parameters
primaryPropertyProperty to which the rule applies.
messageThe message.
Exceptions
ArgumentNullExceptionprimaryProperty is null.
ArgumentExceptionmessage is null, string.Empty or only consists of white spaces.

◆ Required() [3/3]

Csla.Rules.CommonRules.Required.Required ( Core.IPropertyInfo primaryProperty,
Func< string > messageDelegate )
inline

Creates an instance of the rule.

Parameters
primaryPropertyProperty to which the rule applies.
messageDelegateThe localizable message.
Exceptions
ArgumentNullExceptionprimaryProperty or messageDelegate is null.

Member Function Documentation

◆ Execute()

override void Csla.Rules.CommonRules.Required.Execute ( IRuleContext context)
inlineprotectedvirtual

Rule implementation.

Parameters
contextRule context.

Reimplemented from Csla.Rules.BusinessRule.

◆ GetMessage()

override string Csla.Rules.CommonRules.Required.GetMessage ( )
inlineprotectedvirtual

Gets the error message.

Reimplemented from Csla.Rules.PropertyRule.


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