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.Rules.CommonRules.RegExMatch Class Reference

Business rule that evaluates a regular expression. More...

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

Public Types

enum  NullResultOptions { ReturnFalse , ReturnTrue , ConvertToEmptyString }
 List of options for the NullResult property. More...
 

Public Member Functions

 RegExMatch (Csla.Core.IPropertyInfo primaryProperty, string expression)
 Creates an instance of the rule. More...
 
 RegExMatch (Csla.Core.IPropertyInfo primaryProperty, string expression, string message)
 Creates an instance of the rule. More...
 
 RegExMatch (Csla.Core.IPropertyInfo primaryProperty, string expression, Func< string > messageDelegate)
 Creates an instance of the rule. More...
 

Protected Member Functions

override string GetMessage ()
 Gets the error message. More...
 
override void Execute (IRuleContext context)
 Rule implementation. More...
 
- Protected Member Functions inherited from Csla.Rules.CommonRules.CommonBusinessRule
 CommonBusinessRule (Csla.Core.IPropertyInfo primaryProperty)
 Creates an instance of the rule. More...
 
 CommonBusinessRule ()
 Creates an instance of the rule. More...
 
- Protected Member Functions inherited from Csla.Rules.PropertyRule
 PropertyRule ()
 Initializes a new instance of the PropertyRule class. More...
 
 PropertyRule (IPropertyInfo propertyInfo)
 Initializes a new instance of the PropertyRule class. More...
 
- Protected Member Functions inherited from Csla.Rules.BusinessRule
 BusinessRule ()
 Creates an instance of the rule that applies to a business object as a whole. More...
 
 BusinessRule (Csla.Core.IPropertyInfo primaryProperty)
 Creates an instance of the rule that applies to a specfic property. More...
 
- Protected Member Functions inherited from Csla.Rules.BusinessRuleBase
void CanWriteProperty (string argument)
 Allows or blocks changing a property value. More...
 
 BusinessRuleBase (Csla.Core.IPropertyInfo primaryProperty)
 Creates an instance of the rule that applies to a specfic property. More...
 
void LoadProperty (object obj, Csla.Core.IPropertyInfo propertyInfo, object newValue)
 Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does change. More...
 
object ReadProperty (object obj, Csla.Core.IPropertyInfo propertyInfo)
 Reads a property's field value. More...
 

Properties

string Expression [get]
 Gets the regular expression to be evaluated. More...
 
NullResultOptions NullOption [getset]
 Gets or sets a value that controls how null input values are handled. More...
 
- Properties inherited from Csla.Rules.CommonRules.CommonBusinessRule
RuleSeverity Severity [getset]
 Gets or sets the severity for this rule. More...
 
- Properties inherited from Csla.Rules.PropertyRule
string MessageText [getset]
 Gets or sets the error message (constant). More...
 
Func< string > MessageDelegate [getset]
 Gets or sets the error message function for this rule. More...
 
bool HasMessageDelegate [get]
 Gets a value indicating whether this instance has message delegate. More...
 
bool CanRunAsAffectedProperty [getset]
 Gets or sets a value indicating whether this instance can run as affected property. More...
 
bool CanRunOnServer [getset]
 Gets or sets a value indicating whether this instance can run in logical serverside data portal. More...
 
bool CanRunInCheckRules [getset]
 Gets or sets a value indicating whether this instance can run when CheckRules is called on BO. More...
 
- Properties inherited from Csla.Rules.BusinessRule
override bool IsAsync [getprotected set]
 Gets a value indicating whether the rule will run on a background thread. More...
 
- Properties inherited from Csla.Rules.BusinessRuleBase
bool PropertiesLocked [getset]
 Gets or sets a value indicating whether property values should be locked because an async operation is running. More...
 
virtual Csla.Core.IPropertyInfo PrimaryProperty [getset]
 Gets or sets the primary property affected by this rule. More...
 
List< Csla.Core.IPropertyInfoAffectedProperties [get]
 Gets a list of properties affected by this rule. More...
 
List< Csla.Core.IPropertyInfoInputProperties [getprotected set]
 Gets a list of secondary property values to be supplied to the rule when it is executed. More...
 
abstract bool IsAsync [getprotected set]
 Gets a value indicating whether the rule will run on a background thread. More...
 
bool 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). More...
 
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. More...
 
RuleUri RuleUri [getset]
 Sets or gets the rule:// URI object for this rule. More...
 
int Priority [getset]
 Gets the rule priority. More...
 
RunModes RunMode [getset]
 Gets or sets the run in context. More...
 
- Properties inherited from Csla.Rules.IBusinessRuleBase
List< Csla.Core.IPropertyInfoInputProperties [get]
 Gets a list of secondary property values to be supplied to the rule when it is executed. More...
 
List< Csla.Core.IPropertyInfoAffectedProperties [get]
 Gets a list of properties affected by this rule. More...
 
Csla.Core.IPropertyInfo PrimaryProperty [get]
 Gets the primary property affected by this rule. More...
 
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. More...
 
int Priority [get]
 Gets the rule priority. More...
 
bool ProvideTargetWhenAsync [get]
 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). More...
 
RunModes RunMode [get]
 Gets the context in which the rule is allowed to execute. More...
 
bool IsAsync [get]
 Gets a value indicating whether the Execute() method will run asynchronous code. More...
 

Detailed Description

Business rule that evaluates a regular expression.

Definition at line 485 of file Csla/Rules/CommonRules.cs.

Member Enumeration Documentation

◆ NullResultOptions

List of options for the NullResult property.

Enumerator
ReturnFalse 

Indicates that a null value should always result in the rule returning false.

ReturnTrue 

Indicates that a null value should always result in the rule returning true.

ConvertToEmptyString 

Indicates that a null value should be converted to an empty string before the regular expression is evaluated.

Definition at line 493 of file Csla/Rules/CommonRules.cs.

Constructor & Destructor Documentation

◆ RegExMatch() [1/3]

Csla.Rules.CommonRules.RegExMatch.RegExMatch ( Csla.Core.IPropertyInfo  primaryProperty,
string  expression 
)

Creates an instance of the rule.

Parameters
primaryPropertyPrimary property.
expressionRegular expression.

Definition at line 536 of file Csla/Rules/CommonRules.cs.

◆ RegExMatch() [2/3]

Csla.Rules.CommonRules.RegExMatch.RegExMatch ( Csla.Core.IPropertyInfo  primaryProperty,
string  expression,
string  message 
)

Creates an instance of the rule.

Parameters
primaryPropertyProperty to which the rule applies.
expressionRegular expression.
messageThe message.

Definition at line 550 of file Csla/Rules/CommonRules.cs.

◆ RegExMatch() [3/3]

Csla.Rules.CommonRules.RegExMatch.RegExMatch ( Csla.Core.IPropertyInfo  primaryProperty,
string  expression,
Func< string >  messageDelegate 
)

Creates an instance of the rule.

Parameters
primaryPropertyProperty to which the rule applies.
expressionRegular expression.
messageDelegateThe localizable message.

Definition at line 563 of file Csla/Rules/CommonRules.cs.

Member Function Documentation

◆ Execute()

override void Csla.Rules.CommonRules.RegExMatch.Execute ( IRuleContext  context)
protectedvirtual

Rule implementation.

Parameters
contextRule context.

Reimplemented from Csla.Rules.BusinessRule.

Definition at line 582 of file Csla/Rules/CommonRules.cs.

◆ GetMessage()

override string Csla.Rules.CommonRules.RegExMatch.GetMessage ( )
protectedvirtual

Gets the error message.

Reimplemented from Csla.Rules.PropertyRule.

Definition at line 573 of file Csla/Rules/CommonRules.cs.

Property Documentation

◆ Expression

string Csla.Rules.CommonRules.RegExMatch.Expression
get

Gets the regular expression to be evaluated.

Definition at line 523 of file Csla/Rules/CommonRules.cs.

◆ NullOption

NullResultOptions Csla.Rules.CommonRules.RegExMatch.NullOption
getset

Gets or sets a value that controls how null input values are handled.

Definition at line 529 of file Csla/Rules/CommonRules.cs.