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.
IRuleContext.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="IRuleContext.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Context information provided to a business rule</summary>
7//-----------------------------------------------------------------------
8using Csla.Core;
9using System;
10using System.Collections.Generic;
11using System.Text;
12
13namespace Csla.Rules
14{
19 public interface IRuleContext
20 {
25
29 object Target { get; }
30
35 Dictionary<Csla.Core.IPropertyInfo, object> InputPropertyValues { get; }
42 List<IPropertyInfo> DirtyProperties { get; }
47 Dictionary<Csla.Core.IPropertyInfo, object> OutputPropertyValues { get; }
52 List<RuleResult> Results { get; }
57 string OriginPropertyName { get; }
70 bool IsCascadeContext { get; }
84 bool IsCheckRulesContext { get; }
109 void AddErrorResult(string description);
117 void AddErrorResult(string description, bool stopProcessing);
126 void AddErrorResult(Csla.Core.IPropertyInfo property, string description);
132 void AddWarningResult(string description);
140 void AddWarningResult(string description, bool stopProcessing);
148 void AddWarningResult(Csla.Core.IPropertyInfo property, string description);
154 void AddInformationResult(string description);
160 void AddInformationResult(string description, bool stopProcessing);
168 void AddInformationResult(Csla.Core.IPropertyInfo property, string description);
173 void AddSuccessResult(bool stopProcessing);
179 void AddOutValue(object value);
187 void AddOutValue(Csla.Core.IPropertyInfo property, object value);
199 void Complete();
221 bool TryGetInputValue<T>(PropertyInfo<T> propertyInfo, ref T value);
229 bool TryGetInputValue<T>(IPropertyInfo propertyInfo, ref T value);
235 }
236}
Maintains metadata about a property.
Maintains metadata about a property.
Interface defining a business/validation rule implementation.
Context information provided to a business rule when it is invoked.
Definition: IRuleContext.cs:20
bool IsPropertyChangedContext
Gets a value indicating whether this instance is property changed context.
Definition: IRuleContext.cs:77
object Target
Gets a reference to the target business object.
Definition: IRuleContext.cs:29
void AddInformationResult(string description, bool stopProcessing)
Add an Information severity result to the Results list.
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.
RuleContextModes ExecuteContext
Gets the execution context.
void AddWarningResult(string description)
Add a Warning severity result to the Results list.
void AddWarningResult(string description, bool stopProcessing)
Add a Warning severity result to the Results list.
bool IsCheckRulesContext
Gets a value indicating whether this instance is check rules context.
Definition: IRuleContext.cs:84
void AddErrorResult(string description, bool stopProcessing)
Add a Error severity result to the Results list.
bool TryGetInputValue< T >(PropertyInfo< T > propertyInfo, ref T value)
Tries to get the value.
List< IPropertyInfo > DirtyProperties
Gets a list of dirty properties (value was updated).
Definition: IRuleContext.cs:42
List< RuleResult > Results
Gets a list of RuleResult objects containing the results of the rule.
Definition: IRuleContext.cs:52
void AddErrorResult(string description)
Add a Error severity result to the Results list.
IBusinessRuleBase Rule
Gets the rule object.
Definition: IRuleContext.cs:24
bool IsCheckObjectRulesContext
Gets a value indicating whether this instance is check object rules context.
Definition: IRuleContext.cs:91
void AddOutValue(object value)
Add an outbound value to update the rule's primary property on the business object once the rule is c...
void AddWarningResult(Csla.Core.IPropertyInfo property, string description)
Add a Warning severity result to the Results list.
void Complete()
Indicates that the rule processing is complete, so CSLA .NET will process the Results list.
void AddSuccessResult(bool stopProcessing)
Add a Success severity result to the Results list.
void AddInformationResult(Csla.Core.IPropertyInfo property, string description)
Add an Information severity result to the Results list.
Dictionary< Csla.Core.IPropertyInfo, object > OutputPropertyValues
Gets a dictionary containing copies of property values that should be updated in the target object.
Definition: IRuleContext.cs:47
Dictionary< Csla.Core.IPropertyInfo, object > InputPropertyValues
Gets a dictionary containing copies of property values from the target business object.
Definition: IRuleContext.cs:35
void AddInformationResult(string description)
Add an Information severity result to the Results list.
void AddDirtyProperty(Csla.Core.IPropertyInfo property)
Adds a property name as a dirty field (changed value).
void ExecuteRule(IBusinessRuleBase innerRule)
Executes the inner rule from the outer rules context.
void AddErrorResult(Csla.Core.IPropertyInfo property, string description)
Add a Error severity result to the Results list.
string OriginPropertyName
Gets or sets the name of the origin property.
Definition: IRuleContext.cs:57
bool IsCascadeContext
Gets a value indicating whether this instance is cascade context as a result of AffectedProperties.
Definition: IRuleContext.cs:70
T GetInputValue< T >(PropertyInfo< T > propertyInfo)
Gets the value.
IRuleContext GetChainedContext(IBusinessRuleBase rule)
Gets a new RuleContext object for a chained rule.
RuleContextModes
RuleContext mode flags
Definition: RuleContext.cs:24