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

C# IOperand类代码示例

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

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



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

示例1: Bucket

        private Bucket(IOperand operand)
        {
            if (operand == null)
                throw new ArgumentNullException("operand");

            _operand = operand;
        }
开发者ID:BarryDahlberg,项目名称:Comb,代码行数:7,代码来源:Bucket.cs


示例2: BinaryOperationBase

 protected BinaryOperationBase(IOperationResultBuilder operationResultBuilder,
     IOperand fieldRefOperand, IOperand valueOperand)
     : base(operationResultBuilder)
 {
     this.fieldRefOperand = fieldRefOperand;
     this.valueOperand = valueOperand;
 }
开发者ID:chutinhha,项目名称:tvmcorptvs,代码行数:7,代码来源:BinaryOperationBase.cs


示例3: BinaryOperationBase

 protected BinaryOperationBase(IOperationResultBuilder operationResultBuilder,
     IOperand columnOperand, IOperand valueOperand)
     : base(operationResultBuilder)
 {
     this.ColumnOperand = columnOperand;
     this.ValueOperand = valueOperand;
 }
开发者ID:ricardocarneiro,项目名称:sharepoint-3,代码行数:7,代码来源:BinaryOperationBase.cs


示例4: ReplaceLastOperand

        public void ReplaceLastOperand(IOperand operand)
        {
            if (Operands.Count == 0)
            {
                throw new InvalidOperationException("There are no operands to replace.");
            }


            int stealIndex = Operands.Count - 1;
            
            NativeOperation op = Operands[stealIndex] as NativeOperation;

            // Check if the "steal" target is itself something that we can steal from, if so, 
            // recurse. This rule of checkiung association type is a bit confusing, this should
            // be a property?

            if (op !=null && op.Operands.Count > 1 && op.AssociationType == AssociationType.Multiplicaton)
            {
                IOperation func = (IOperation)op;
                func.ReplaceLastOperand(operand);
            }
            else
            {
                _Operands[Operands.Count - 1] = operand;
            }
        }
开发者ID:kaleb,项目名称:CsQuery,代码行数:26,代码来源:NativeOperation.cs


示例5: GreaterThan

 public IOperand GreaterThan(IOperand rhs)
 {
     if (!(rhs is LongOperand))
         throw new RPN_Exception("Argument invalid in LongOperand.> : rhs");
     BoolOperand oprResult = new BoolOperand("Result");
     oprResult.Value = ((long)this.Value > (long)((Operand)rhs).Value) ? true : false;
     return oprResult;
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:8,代码来源:LongOperand.cs


示例6: EqualTo

 /// IComparisonOperators methods.  Return values are always BooleanOperands type
 public IOperand EqualTo(IOperand rhs)
 {
     if (!(rhs is LongOperand))
         throw new RPN_Exception("Argument invalid in LongOperand.== : rhs");
     BoolOperand oprResult = new BoolOperand("Result");
     oprResult.Value = (long)this.Value == (long)((Operand)rhs).Value;
     return oprResult;
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:9,代码来源:LongOperand.cs


示例7: Divide

 public IOperand Divide(IOperand rhs)
 {
     if (!(rhs is LongOperand))
         throw new RPN_Exception("Argument invalid in LongOperand.Divide : rhs");
     LongOperand oprResult = new LongOperand("Result", Type.GetType("System.Int64"));
     oprResult.Value = (long)this.Value / (long)((Operand)rhs).Value;
     return oprResult;
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:8,代码来源:LongOperand.cs


示例8: LessThanOrEqualTo

 public IOperand LessThanOrEqualTo(IOperand rhs)
 {
     if (!(rhs is LongOperand))
         throw new RPN_Exception("Argument invalid in LongOperand.<= : rhs");
     BoolOperand oprResult = new BoolOperand("Result");
     oprResult.Value = ((long)this.Value <= (long)((Operand)rhs).Value) ? true : false;
     return oprResult;
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:8,代码来源:LongOperand.cs


示例9: OR

 public IOperand OR(IOperand rhs)
 {
     if (!(rhs is BoolOperand))
         throw new RPN_Exception("Argument invalid in BoolOperand.|| : rhs");
     BoolOperand oprResult = new BoolOperand("Result");
     oprResult.Value = ((bool)this.Value || (bool)((Operand)rhs).Value) ? true : false;
     return oprResult;
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:8,代码来源:BoolOperand.cs


示例10: Match

        internal static bool Match(PackageItem package, IOperand operand)
        {
            var expression = operand as Expression;

            if (expression != null)
                return MatchExpression(package, expression);
            return MatchPredicate(package, operand);
        }
开发者ID:henjuv,项目名称:Mg2,代码行数:8,代码来源:QueryMatcher.cs


示例11: ReplaceLastOperand

        public void ReplaceLastOperand(IOperand operand)
        {
            if (Operands.Count == 0)
            {
                throw new InvalidOperationException("There are no operands to replace.");
            }

            _Operands[Operands.Count - 1] = operand;
        }
开发者ID:BenHall,项目名称:ProgNet2012-Completed,代码行数:9,代码来源:NativeOperation.cs


示例12: CopyTo

 protected override IOperand CopyTo(IOperand operand)
 {
     NativeOperation target = (NativeOperation)operand;
     foreach (var item in _Operators)
     {
         target._Operators.Add(item);
     }
     return base.CopyTo(target);
 }
开发者ID:kaleb,项目名称:CsQuery,代码行数:9,代码来源:NativeOperation.cs


示例13: DateRangesOverlapOperation

 public DateRangesOverlapOperation(IOperationResultBuilder operationResultBuilder,
     IOperand startFieldRefOperand, IOperand stopFieldRefOperand, IOperand recurrenceFieldRefOperand, IOperand dateTimeOperand)
     : base(operationResultBuilder)
 {
     this.startFieldRefOperand = startFieldRefOperand;
     this.stopFieldRefOperand = stopFieldRefOperand;
     this.recurrenceFieldRefOperand = recurrenceFieldRefOperand;
     this.dateTimeOperand = dateTimeOperand;
 }
开发者ID:chutinhha,项目名称:aiaintranet,代码行数:9,代码来源:DateRangesOverlapOperation.cs


示例14: MatchPredicate

        private static bool MatchPredicate(PackageItem package, IOperand predicate)
        {
            var unaryPredicate = predicate as UnaryPredicate;
            if (unaryPredicate != null)
                return MatchPredicate(package, unaryPredicate);

            var binaryPredicate = predicate as BinaryPredicate;
            if (binaryPredicate != null)
                return MatchPredicate(package, binaryPredicate);

            return true;
        }
开发者ID:henjuv,项目名称:Mg2,代码行数:12,代码来源:QueryMatcher.cs


示例15: Range

        private Range(IOperand min = null, IOperand max = null, bool minInclusive = false, bool maxInclusive = false)
        {
            if (min == null && max == null)
                throw new ArgumentException("Min and max cannot both be null.");

            // TODO check min < max?

            Min = min;
            Max = max;
            MinInclusive = minInclusive;
            MaxInclusive = maxInclusive;
        }
开发者ID:roberthannon,项目名称:Comb,代码行数:12,代码来源:Range.cs


示例16: Eval

 //bool bBinaryOperator = true;
 //{"&&", "||"}
 public override IOperand Eval(IOperand lhs, IOperand rhs)
 {
     if (!(lhs is ILogicalOperations))
         throw new RPN_Exception("Argument invalid in LogicalOperator.Eval - Invalid Expression : lhs");
     switch (m_szOperator)
     {
         case "&&":
             return ((ILogicalOperations)lhs).AND(rhs);
         case "||":
             return ((ILogicalOperations)lhs).OR(rhs);
     }
     throw new RPN_Exception("Unsupported Logical operation " + m_szOperator);
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:15,代码来源:LogicalOperator.cs


示例17: CreateFieldRefOperand

 // ----- Field Ref Operand -----
 public IOperand CreateFieldRefOperand(Expression expr, IOperand valueOperand)
 {
     if (expr is UnaryExpression)
     {
         expr = ((UnaryExpression)expr).Operand;
     }
     var methodCallExpression = expr as MethodCallExpression;
     var argumentExpression = methodCallExpression.Arguments[0];
     if (argumentExpression is ConstantExpression)
     {
         return this.createFieldRefOperandFromConstantExpression(argumentExpression as ConstantExpression,
             valueOperand);
     }
     return this.createFieldRefOperandFromNonConstantExpression(argumentExpression, valueOperand);
 }
开发者ID:chutinhha,项目名称:tvmcorptvs,代码行数:16,代码来源:OperandBuilder.cs


示例18: Eval

 //bool bBinaryOperator = true;
 public override IOperand Eval(IOperand lhs, IOperand rhs)
 {
     if (!(lhs is IArithmeticOperations))
         throw new RPN_Exception("Argument invalid in ArithmeticOperator.Eval - Invalid Expression : lhs");
     switch (m_szOperator)
     {
         case "+":
             return ((IArithmeticOperations)lhs).Plus(rhs);
         case "-":
             return ((IArithmeticOperations)lhs).Minus(rhs);
         case "*":
             return ((IArithmeticOperations)lhs).Multiply(rhs);
         case "/":
             return ((IArithmeticOperations)lhs).Divide(rhs);
         case "%":
             return ((IArithmeticOperations)lhs).Modulo(rhs);
     }
     throw new RPN_Exception("Unsupported Arithmetic operation " + m_szOperator);
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:20,代码来源:ArithmeticOperator.cs


示例19: Eval

 //bool bBinaryOperator = true;
 //{"==", "!=","<", "<=", ">", ">="}
 public override IOperand Eval(IOperand lhs, IOperand rhs)
 {
     if (!(lhs is IComparisonOperations))
         throw new RPN_Exception("Argument invalid in ComparisonOperator.Eval - Invalid Expression : lhs");
     switch (m_szOperator)
     {
         case "==":
             return ((IComparisonOperations)lhs).EqualTo(rhs);
         case "!=":
             return ((IComparisonOperations)lhs).NotEqualTo(rhs);
         case "<":
             return ((IComparisonOperations)lhs).LessThan(rhs);
         case "<=":
             return ((IComparisonOperations)lhs).LessThanOrEqualTo(rhs);
         case ">":
             return ((IComparisonOperations)lhs).GreaterThan(rhs);
         case ">=":
             return ((IComparisonOperations)lhs).GreaterThanOrEqualTo(rhs);
     }
     throw new RPN_Exception("Unsupported Comparison operation " + m_szOperator);
 }
开发者ID:kinshuk4,项目名称:XENONParser,代码行数:23,代码来源:ComparisonOperator.cs


示例20: Evaluate

        public IOperand Evaluate(IOperand op1)
        {
            if (DoubleDouble != null)
            {
                if (op1.Type == typeof(double))
                {
                    var dOp1 = op1 as GenericOperand<double>;
                    return new GenericOperand<double>(DoubleDouble(dOp1.Value));
                }
            }

            if (StringDouble != null)
            {
                if (op1.Type == typeof(string))
                {
                    var dOp1 = op1 as GenericOperand<string>;
                    return new GenericOperand<double>(StringDouble(dOp1.Value));
                }
            }

            if (DoubleTimespan != null)
            {
                if (op1.Type == typeof(double))
                {
                    var dOp1 = op1 as GenericOperand<double>;
                    return new GenericOperand<TimeSpan>(DoubleTimespan(dOp1.Value));
                }
            }

            if (TimespanDouble != null)
            {
                if (op1.Type == typeof(TimeSpan))
                {
                    var dOp1 = op1 as GenericOperand<TimeSpan>;
                    return new GenericOperand<double>(TimespanDouble(dOp1.Value));
                }
            }

            throw new ExpressionException(_name2 + " operator used incorrectly.");
        }
开发者ID:steveklewis,项目名称:Expression-Evaluator,代码行数:40,代码来源:Procedure.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IOperation类代码示例发布时间:2022-05-24
下一篇:
C# IOperableTrigger类代码示例发布时间: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