Пример #1
0
        private void GridUpdatedByUserHandler(object sender, UpdatedByUserEventArgs e)
        {
            if (isListeningGridUpdates)
            {
                SaveGridState();
            }

            OnGridChanged();
        }
Пример #2
0
        private void CellChangedHandler(object sender, UpdatedByUserEventArgs e)
        {
            var targetCell = e.UpdatedCell as ParsedCell;

            if (targetCell == null)
            {
                return;
            }

            if (cellsInCycle.Contains(targetCell) || targetCell.HasSpreadError)
            {
                GlobalRefresh();
                return;
            }

            ClearCellsSpreadErrorListeners(targetCell.Coordinates);

            UpdateGraphForCell(targetCell);
            if (!cellGraph.ContainsKey(targetCell))
            {
                targetCell.Value = null;
            }

            GlobalRefresh();
            return;

            //var path = new Stack<ParsedCell>();
            //if (HasCycleWithNode(path, new HashSet<ParsedCell>(), targetCell, targetCell)) {
            //	GlobalRefresh();
            //}

            //if (!targetCell.Calculable) {
            //	Debug.Assert(cellCoords.ContainsKey(targetCell));
            //	SpreadErrorFromCell(targetCell, cellCoords[targetCell]);
            //} else {
            //	ListenToChildsErrors(targetCell);
            //}
        }