当前位置: 首页>>代码示例>>C#>>正文


C# RuleContext.GetChainedContext方法代码示例

本文整理汇总了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);
            }

            
        }
开发者ID:rbocobo,项目名称:MagenicMasters.Csla,代码行数:25,代码来源:TimeRangeRule.cs

示例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);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:14,代码来源:CheckFilteredCrossReferenceRule.cs

示例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));
   }
 }
开发者ID:nschonni,项目名称:csla-svn,代码行数:9,代码来源:StringRequiredIfUS.cs

示例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);
   }
 }
开发者ID:BiYiTuan,项目名称:csla,代码行数:15,代码来源:IsNotNew.cs

示例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));
     }
 }
开发者ID:mparsin,项目名称:Elements,代码行数:13,代码来源:LDAPSearchFilterValidationRule.cs

示例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);
   }
 }
开发者ID:BiYiTuan,项目名称:csla,代码行数:16,代码来源:CanWrite.cs

示例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));
 }
开发者ID:mparsin,项目名称:Elements,代码行数:10,代码来源:LDAPValidationRule.cs


注:本文中的RuleContext.GetChainedContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。