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


C# Eval.GetType方法代码示例

本文整理汇总了C#中Eval.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Eval.GetType方法的具体用法?C# Eval.GetType怎么用?C# Eval.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Eval的用法示例。


在下文中一共展示了Eval.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EvaluateRef

 private static RefEval EvaluateRef(Eval arg)
 {
     if (arg is RefEval)
     {
         return (RefEval)arg;
     }
     if (arg is ErrorEval)
     {
         throw new EvaluationException((ErrorEval)arg);
     }
     throw new ArgumentException("Unexpected ref arg class (" + arg.GetType().Name + ")");
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:12,代码来源:RangeEval.cs

示例2: CollectValue

 private static void CollectValue(Eval arg, IList temp, bool mustBeNumber)
 {
     if (arg is ErrorEval)
     {
         throw new EvaluationException((ErrorEval)arg);
     }
     if (arg == BlankEval.INSTANCE || arg is BoolEval || arg is StringEval)
     {
         if (mustBeNumber)
         {
             throw EvaluationException.InvalidValue();
         }
         return;
     }
     if (arg is NumberEval)
     {
         temp.Add(((NumberEval)arg).NumberValue);
         return;
     }
     throw new InvalidOperationException("Unexpected value type (" + arg.GetType().Name + ")");
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:21,代码来源:Mode.cs

示例3: CreateCriteriaPredicate

        public static I_MatchPredicate CreateCriteriaPredicate(Eval evaluatedCriteriaArg)
        {
            if (evaluatedCriteriaArg is NumberEval)
            {
                return new NumberMatcher(((NumberEval)evaluatedCriteriaArg).NumberValue, CmpOp.OP_NONE);
            }
            if (evaluatedCriteriaArg is BoolEval)
            {
                return new BooleanMatcher(((BoolEval)evaluatedCriteriaArg).BooleanValue, CmpOp.OP_NONE);
            }

            if (evaluatedCriteriaArg is StringEval)
            {
                return CreateGeneralMatchPredicate((StringEval)evaluatedCriteriaArg);
            }
            if (evaluatedCriteriaArg == BlankEval.INSTANCE)
            {
                return null;
            }
            throw new Exception("Unexpected type for criteria ("
                    + evaluatedCriteriaArg.GetType().Name + ")");
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:22,代码来源:Countif.cs

示例4: CountMatchingCellsInArea

 /**
  * @return the number of Evaluated cells in the range that match the specified criteria
  */
 private Eval CountMatchingCellsInArea(Eval rangeArg, I_MatchPredicate criteriaPredicate)
 {
     int result;
     if (rangeArg is RefEval)
     {
         result = CountUtils.CountMatchingCell((RefEval)rangeArg, criteriaPredicate);
     }
     else if (rangeArg is AreaEval)
     {
         result = CountUtils.CountMatchingCellsInArea((AreaEval)rangeArg, criteriaPredicate);
     }
     else
     {
         throw new ArgumentException("Bad range arg type (" + rangeArg.GetType().Name + ")");
     }
     return new NumberEval(result);
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:20,代码来源:Countif.cs

示例5: EvaluateLookupRange

        private static ValueVector EvaluateLookupRange(Eval eval)
        {
            if (eval is RefEval)
            {
                RefEval re = (RefEval)eval;
                return new SingleValueVector(re.InnerValueEval);
            }
            if (eval is AreaEval)
            {
                ValueVector result = LookupUtils.CreateVector((AreaEval)eval);
                if (result == null)
                {
                    throw new EvaluationException(ErrorEval.NA);
                }
                return result;
            }

            // Error handling for lookup_range arg Is also Unusual
            if (eval is NumericValueEval)
            {
                throw new EvaluationException(ErrorEval.NA);
            }
            if (eval is StringEval)
            {
                StringEval se = (StringEval)eval;
                double d = OperandResolver.ParseDouble(se.StringValue);
                if (double.IsNaN(d))
                {
                    // plain string
                    throw new EvaluationException(ErrorEval.VALUE_INVALID);
                }
                // else looks like a number
                throw new EvaluationException(ErrorEval.NA);
            }
            throw new Exception("Unexpected eval type (" + eval.GetType().Name + ")");
        }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:36,代码来源:Match.cs

示例6: CreateValueVector

 private static ValueVector CreateValueVector(Eval arg)
 {
     if (arg is ErrorEval)
     {
         throw new EvaluationException((ErrorEval)arg);
     }
     if (arg is AreaEval)
     {
         return new AreaValueArray((AreaEval)arg);
     }
     if (arg is RefEval)
     {
         return new RefValueArray((RefEval)arg);
     }
     if (arg is ValueEval)
     {
         return new SingleCellValueArray((ValueEval)arg);
     }
     throw new InvalidOperationException("Unexpected eval class (" + arg.GetType().Name + ")");
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:20,代码来源:XYNumericFunction.cs


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