Esempio n. 1
0
        public void OnChange()
        {
            var newDynamicTree = diffApplier.ToDynamic(worldTreeService.EditingWorld);

            // todo: initialize this
            previousDynamicTree = previousDynamicTree ?? newDynamicTree;

            var diff = diffBuilder.BuildDiffs(previousDynamicTree, newDynamicTree, diffIdentityComparer);

            if (diff.IsEmpty)
            {
                return;
            }
            var undoable = new DiffUndoable(diffApplier, worldTreeService.EditingWorld, diff);

            undoStack.Push(undoable);
            redoStack.Clear();
            previousDynamicTree = newDynamicTree;
            NotifyObserver();
        }