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