Пример #1
0
        public void AcceptPlainValueDependency(int bookIndex, int sheetIndex,
                                               int rowIndex, int columnIndex, ValueEval value)
        {
            // Tell the currently evaluating cell frame that it Has a dependency on the specified
            int prevFrameIndex = _evaluationFrames.Count - 1;

            if (prevFrameIndex < 0)
            {
                // Top level frame, there is no 'cell' above this frame that is using the current cell
            }
            else
            {
                CellEvaluationFrame consumingFrame = (CellEvaluationFrame)_evaluationFrames[prevFrameIndex];
                if (value == BlankEval.instance)
                {
                    consumingFrame.AddUsedBlankCell(bookIndex, sheetIndex, rowIndex, columnIndex);
                }
                else
                {
                    PlainValueCellCacheEntry cce = _cache.GetPlainValueEntry(bookIndex, sheetIndex,
                                                                             rowIndex, columnIndex, value);
                    consumingFrame.AddSensitiveInputCell(cce);
                }
            }
        }
Пример #2
0
        public void UpdateCacheResult(ValueEval result)
        {
            int nFrames = _evaluationFrames.Count;

            if (nFrames < 1)
            {
                throw new InvalidOperationException("Call To endEvaluate without matching call To startEvaluate");
            }
            CellEvaluationFrame frame = (CellEvaluationFrame)_evaluationFrames[nFrames - 1];

            frame.UpdateFormulaResult(result);
        }
Пример #3
0
        public void AcceptFormulaDependency(CellCacheEntry cce)
        {
            // Tell the currently evaluating cell frame that it Has a dependency on the specified
            int prevFrameIndex = _evaluationFrames.Count - 1;

            if (prevFrameIndex < 0)
            {
                // Top level frame, there is no 'cell' above this frame that is using the current cell
            }
            else
            {
                CellEvaluationFrame consumingFrame = (CellEvaluationFrame)_evaluationFrames[prevFrameIndex];
                consumingFrame.AddSensitiveInputCell(cce);
            }
        }
Пример #4
0
        /**
         * Notifies this evaluation tracker that the evaluation of the specified cell is complete. <p/>
         *
         * Every successful call To <c>startEvaluate</c> must be followed by a call To <c>endEvaluate</c> (recommended in a finally block) To enable
         * proper tracking of which cells are being evaluated at any point in time.<p/>
         *
         * Assuming a well behaved client, parameters To this method would not be
         * required. However, they have been included To assert correct behaviour,
         * and form more meaningful error messages.
         */
        public void EndEvaluate(CellCacheEntry cce)
        {
            int nFrames = _evaluationFrames.Count;

            if (nFrames < 1)
            {
                throw new InvalidOperationException("Call To endEvaluate without matching call To startEvaluate");
            }

            nFrames--;
            CellEvaluationFrame frame = (CellEvaluationFrame)_evaluationFrames[nFrames];

            if (cce != frame.GetCCE())
            {
                throw new InvalidOperationException("Wrong cell specified. ");
            }
            // else - no problems so pop current frame
            _evaluationFrames.RemoveAt(nFrames);
            _currentlyEvaluatingCells.Remove(cce);
        }