9using System.Collections.Generic;
13using System.ComponentModel;
14using System.Threading;
38 : base(primaryProperty)
46 if (context.
Target !=
null)
47 throw new ArgumentOutOfRangeException(
"context.Target must be null");
49 BackgroundWorker worker =
new BackgroundWorker();
53 worker.DoWork += (s, e) =>
57 System.Threading.Thread.Sleep(50);
59 if (name !=
null && name.ToString() ==
"error")
60 avrc.AddErrorResult(
"error detected");
62 worker.RunWorkerCompleted += (s, e) =>
66 avrc.AddErrorResult(e.Error.Message);
71 worker.RunWorkerAsync(context);
77 private Rule1 _innerRule;
80 : base(primaryProperty)
83 _innerRule =
new Rule1(primaryProperty);
89 if (context.
Target !=
null)
90 throw new ArgumentOutOfRangeException(
"context.Target must be null");
98 private Rule1 _innerRule;
101 : base(primaryProperty)
104 _innerRule =
new Rule1(primaryProperty);
111 if (context.
Target ==
null)
112 throw new ArgumentOutOfRangeException(
"context.Target must not be null");
119 private void Create()
This is the base class from which most business objects will be derived.
Maintains metadata about a property.
bool ProvideTargetWhenAsync
Gets a value indicating that the Target property should be set even for an async rule (note that usin...
List< Csla.Core.IPropertyInfo > InputProperties
Gets a list of secondary property values to be supplied to the rule when it is executed.
Base class used to create business and validation rules.
override bool IsAsync
Gets a value indicating whether the rule will run on a background thread.
Tracks the business rules for a business object.
void AddRule(IBusinessRuleBase rule)
Associates a business rule with the business object.
Context information provided to a business rule when it is invoked.
override void Execute(IRuleContext context)
Business or validation rule implementation.
Rule1(Csla.Core.IPropertyInfo primaryProperty)
override void Execute(IRuleContext context)
Business or validation rule implementation.
Rule2(Csla.Core.IPropertyInfo primaryProperty)
override void Execute(IRuleContext context)
Business or validation rule implementation.
Rule3(Csla.Core.IPropertyInfo primaryProperty)
static PropertyInfo< string > NameProperty
override void AddBusinessRules()
Maintains metadata about a property.
Interface defining a business/validation rule implementation.
Context information provided to a business rule when it is invoked.
object Target
Gets a reference to the target business object.
IRuleContext GetChainedContext(IBusinessRuleBase rule)
Gets a new RuleContext object for a chained rule.