本文整理汇总了C#中AreaEval.GetValueAt方法的典型用法代码示例。如果您正苦于以下问题:C# AreaEval.GetValueAt方法的具体用法?C# AreaEval.GetValueAt怎么用?C# AreaEval.GetValueAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AreaEval
的用法示例。
在下文中一共展示了AreaEval.GetValueAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChooseSingleElementFromAreaInternal
/**
* @return possibly <tt>ErrorEval</tt>, and <c>null</c>
*/
private static ValueEval ChooseSingleElementFromAreaInternal(AreaEval ae,
int srcCellRow, short 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.GetValueAt(srcCellRow, ae.FirstColumn);
}
if (!ae.IsRow)
{
// multi-column, multi-row area
if (ae.ContainsRow(srcCellRow) && ae.ContainsColumn(srcCellCol))
{
return ae.GetValueAt(ae.FirstRow, ae.FirstColumn);
}
throw EvaluationException.InvalidValue();
}
if (!ae.ContainsColumn(srcCellCol))
{
throw EvaluationException.InvalidValue();
}
return ae.GetValueAt(ae.FirstRow, srcCellCol);
}