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


C# AreaEval.GetAbsoluteValue方法代码示例

本文整理汇总了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);
        }
开发者ID:89sos98,项目名称:npoi,代码行数:59,代码来源:OperandResolver.cs

示例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);
 }
开发者ID:89sos98,项目名称:npoi,代码行数:5,代码来源:TestAreaEval.cs


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