本文整理汇总了C#中RuleContext.GetChainedContext方法的典型用法代码示例。如果您正苦于以下问题:C# RuleContext.GetChainedContext方法的具体用法?C# RuleContext.GetChainedContext怎么用?C# RuleContext.GetChainedContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleContext
的用法示例。
在下文中一共展示了RuleContext.GetChainedContext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
protected override void Execute(RuleContext context)
{
DateTime startTime = (DateTime) context.InputPropertyValues[startPropertyInfo];
DateTime endTime = (DateTime)context.InputPropertyValues[endPropertyInfo];
if (DateTime.Compare(startTime, endTime) >= 0)
{
context.AddErrorResult(ValidationMessages.InvalidTimeRange);
}
else if ((endTime - startTime).Hours <= 0)
{
context.AddErrorResult(ValidationMessages.MinHourInvalid);
}
else
{
var chainedContext1 = context.GetChainedContext(InnerTopOfHourStartRule);
InnerTopOfHourStartRule.Execute(chainedContext1);
var chainedContext2 = context.GetChainedContext(InnerTopOfHourEndRule);
InnerTopOfHourEndRule.Execute(chainedContext2);
}
}
示例2: Execute
/// <summary>
/// Executes the business rule.
/// </summary>
/// <param name="context">The rule context.</param>
/// <exception cref="System.ArgumentNullException">context</exception>
/// <exception cref="ArgumentNullException">The <paramref name="context" /> parameter is null.</exception>
protected override void Execute(RuleContext context)
{
if (context == null)
throw new ArgumentNullException("context");
var chainedContext = context.GetChainedContext(InnerRule);
InnerRule.Execute(chainedContext);
}
示例3: Execute
protected override void Execute(RuleContext context)
{
// TODO: Add actual rule code here.
var country = (string)context.InputPropertyValues[_countryProperty];
if (country == CountryNVL.UnitedStates)
{
_innerRule.Execute(context.GetChainedContext(_innerRule));
}
}
示例4: Execute
/// <summary>
/// Executes the rule
/// </summary>
/// <param name="context">
/// The rule context.
/// </param>
protected override void Execute(RuleContext context)
{
var target = (Csla.Core.ITrackStatus)context.Target;
if (!target.IsNew)
{
var chainedContext = context.GetChainedContext(InnerRule);
InnerRule.Execute(chainedContext);
}
}
示例5: Execute
/// <summary>
/// Business or validation rule implementation.
/// </summary>
/// <param name="context">Rule context object.</param>
protected override void Execute(RuleContext context)
{
var ldapSearchFilter = context.InputPropertyValues[PrimaryProperty] as string;
if (string.IsNullOrWhiteSpace(ldapSearchFilter) &&
(LdapServerTypes) context.InputPropertyValues[_ldapServerType] == LdapServerTypes.LdapServer)
{
_ldapSearchFilterRequired.Execute(context.GetChainedContext(_ldapSearchFilterRequired));
}
}
示例6: Execute
/// <summary>
/// Executes the rule
/// </summary>
/// <param name="context">
/// The rule context.
/// </param>
protected override void Execute(RuleContext context)
{
var target = (Csla.Core.BusinessBase)context.Target;
if (target.CanWriteProperty(PrimaryProperty))
{
var chainedContext = context.GetChainedContext(InnerRule);
InnerRule.Execute(chainedContext);
}
}
示例7: Execute
/// <summary>
/// Business or validation rule implementation.
/// </summary>
/// <param name="context">Rule context object.</param>
protected override void Execute(RuleContext context)
{
var ldapServerPath = context.InputPropertyValues[PrimaryProperty] as string;
if ((bool)context.InputPropertyValues[_useLDAPForLogin] && string.IsNullOrWhiteSpace(ldapServerPath))
_ldapServerPathRequired.Execute(context.GetChainedContext(_ldapServerPathRequired));
}