本文整理汇总了C#中AreaEval.GetAbsoluteValue方法的典型用法代码示例。如果您正苦于以下问题:C# AreaEval.GetAbsoluteValue方法的具体用法?C# AreaEval.GetAbsoluteValue怎么用?C# AreaEval.GetAbsoluteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AreaEval
的用法示例。
在下文中一共展示了AreaEval.GetAbsoluteValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChooseSingleElementFromAreaInternal
/**
* @return possibly <c>ErrorEval</c>, and <c>null</c>
*/
private static ValueEval ChooseSingleElementFromAreaInternal(AreaEval ae,
int srcCellRow, int srcCellCol)
{
//if (false)
//{
// // this is too simplistic
// if (ae.ContainsRow(srcCellRow) && ae.ContainsColumn(srcCellCol))
// {
// throw new EvaluationException(ErrorEval.CIRCULAR_REF_ERROR);
// }
// /*
// Circular references are not dealt with directly here, but it is worth noting some Issues.
// ANY one of the return statements in this method could return a cell that is identical
// to the one immediately being Evaluated. The evaluating cell is identified by srcCellRow,
// srcCellRow AND sheet. The sheet is not available in any nearby calling method, so that's
// one reason why circular references are not easy to detect here. (The sheet of the returned
// cell can be obtained from ae if it is an Area3DEval.)
// Another reason there's little value in attempting to detect circular references here Is
// that only direct circular references could be detected. If the cycle involved two or more
// cells this method could not detect it.
// Logic to detect evaluation cycles of all kinds has been coded in EvaluationCycleDetector
// (and HSSFFormulaEvaluator).
// */
//}
if (ae.IsColumn)
{
if (ae.IsRow)
{
return ae.GetRelativeValue(0, 0);
}
if (!ae.ContainsRow(srcCellRow))
{
throw EvaluationException.InvalidValue();
}
return ae.GetAbsoluteValue(srcCellRow, ae.FirstColumn);
}
if (!ae.IsRow)
{
// multi-column, multi-row area
if (ae.ContainsRow(srcCellRow) && ae.ContainsColumn(srcCellCol))
{
return ae.GetAbsoluteValue(ae.FirstRow, ae.FirstColumn);
}
throw EvaluationException.InvalidValue();
}
if (!ae.ContainsColumn(srcCellCol))
{
throw EvaluationException.InvalidValue();
}
return ae.GetAbsoluteValue(ae.FirstRow, srcCellCol);
}
示例2: Confirm
private static void Confirm(int expectedValue, AreaEval ae, int row, int col)
{
NumberEval v = (NumberEval)ae.GetAbsoluteValue(row, col);
Assert.AreEqual(expectedValue, v.NumberValue, 0.0);
}