• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IContextExpression类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IContextExpression的典型用法代码示例。如果您正苦于以下问题:C# IContextExpression类的具体用法?C# IContextExpression怎么用?C# IContextExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IContextExpression类属于命名空间,在下文中一共展示了IContextExpression类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DataBoundAssertion

        protected DataBoundAssertion(IContextExpression expression)
        {
            if (expression == null) 
                throw new ArgumentNullException("expression");

            _expression = expression;
        }
开发者ID:elmah,项目名称:Elmah,代码行数:7,代码来源:DataBoundAssertion.cs


示例2: RegexMatchAssertion

        public RegexMatchAssertion(IContextExpression source, Regex regex)
            : base(source)
        {
            if (regex == null)
                throw new ArgumentNullException("regex");

            _regex = regex;
        }
开发者ID:k4gdw,项目名称:ELMAH,代码行数:8,代码来源:RegexMatchAssertion.cs


示例3: TypeAssertion

        public TypeAssertion(IContextExpression source, Type expectedType, bool byCompatibility)
            : base(MaskNullExpression(source))
        {
            if (expectedType == null)
                throw new ArgumentNullException("expectedType");

            if (expectedType.IsInterface || (expectedType.IsClass && expectedType.IsAbstract))
            {
                //
                // Interfaces and abstract classes will always have an
                // ancestral relationship.
                //

                byCompatibility = true;
            }

            _expectedType = expectedType;
            _byCompatibility = byCompatibility;
        }
开发者ID:kjana83,项目名称:ELMAH,代码行数:19,代码来源:TypeAssertion.cs


示例4: ComparisonAssertion

        public ComparisonAssertion(Predicate<int> predicate, IContextExpression source, TypeCode type, string value)
            : base(source)
        {
            if (predicate == null)
                throw new ArgumentNullException("predicate");

            _predicate = predicate;

            if (type == TypeCode.DBNull
                || type == TypeCode.Empty
                || type == TypeCode.Object)
            {
                string message = string.Format(
                    "The {0} value type is invalid for a comparison.", type.ToString());
                throw new ArgumentException(message, "type");
            }

            //
            // Convert the expected value to the comparison type and
            // save it as a field.
            //

            _expectedValue = Convert.ChangeType(value, type/*, FIXME CultureInfo.InvariantCulture */);
        }
开发者ID:stewart-rae,项目名称:Elmah,代码行数:24,代码来源:ComparisonAssertion.cs


示例5: IsNullAssertion

 public IsNullAssertion(IContextExpression expression)
     : base(expression)
 {
 }
开发者ID:k4gdw,项目名称:ELMAH,代码行数:4,代码来源:IsNullAssertion.cs


示例6: MaskNullExpression

 private static IContextExpression MaskNullExpression(IContextExpression expression)
 {
     return expression != null
          ? expression
          : new DelegatedContextExpression(new ContextExpressionEvaluationHandler(EvaluateToException));
 }
开发者ID:kjana83,项目名称:ELMAH,代码行数:6,代码来源:TypeAssertion.cs


示例7: MaskNullExpression

 private static IContextExpression MaskNullExpression(IContextExpression expression)
 {
     return expression ?? new DelegatedContextExpression(EvaluateToException);
 }
开发者ID:ramsenthil18,项目名称:elmah,代码行数:4,代码来源:TypeAssertion.cs


示例8: assert_is_type_compatible

 public static IAssertion assert_is_type_compatible(IContextExpression binding, Type type)
 {
     return new TypeAssertion(binding, type, /* byCompatibility */ true);
 }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:4,代码来源:AssertionFactory.cs


示例9: assert_is_null

 public static IAssertion assert_is_null(IContextExpression binding)
 {
     return new IsNullAssertion(binding);
 }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:4,代码来源:AssertionFactory.cs


示例10: assert_is_not_null

 public static IAssertion assert_is_not_null(IContextExpression binding)
 {
     return new UnaryNotAssertion(assert_is_null(binding));
 }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:4,代码来源:AssertionFactory.cs


示例11: assert_greater_or_equal

 public static IAssertion assert_greater_or_equal(IContextExpression binding, TypeCode type, string value)
 {
     return new ComparisonAssertion(ComparisonResults.GreaterOrEqual, binding, type, value);
 }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:4,代码来源:AssertionFactory.cs


示例12: assert_regex

        public static IAssertion assert_regex(IContextExpression binding, string pattern, bool caseSensitive, bool dontCompile)
        {
            if ((pattern ?? string.Empty).Length == 0)
                return StaticAssertion.False;

            //
            // NOTE: There is an assumption here that most uses of this
            // assertion will be for culture-insensitive matches. Since
            // it is difficult to imagine all the implications of involving
            // a culture at this point, it seems safer to just err with the
            // invariant culture settings.
            //

            var options = RegexOptions.CultureInvariant;

            if (!caseSensitive)
                options |= RegexOptions.IgnoreCase;

            if (!dontCompile)
                options |= RegexOptions.Compiled;

            return new RegexMatchAssertion(binding, new Regex(pattern, options));
        }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:23,代码来源:AssertionFactory.cs


示例13: assert_not_equal

 public static IAssertion assert_not_equal(IContextExpression binding, TypeCode type, string value)
 {
     return new UnaryNotAssertion(assert_equal(binding, type, value));
 }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:4,代码来源:AssertionFactory.cs


示例14: assert_lesser

 public static IAssertion assert_lesser(IContextExpression binding, TypeCode type, string value)
 {
     return new ComparisonAssertion(ComparisonResults.Lesser, binding, type, value);
 }
开发者ID:boena,项目名称:elmah-with-custom-data,代码行数:4,代码来源:AssertionFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IContextMenu类代码示例发布时间:2022-05-24
下一篇:
C# IContextBoundSettingsStore类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap