Пример #1
0
        public void SetActiveContext(object contextSource)
        {
            if (!_contextMapping.ContainsKey(contextSource))
            {
                _contextMapping.Add(contextSource, new UndoRedoContext());
            }

            _activeContext = _contextMapping[contextSource];
        }
Пример #2
0
        public void Cleanup()
        {
            _activeContext = null;

            foreach (var item in _contextMapping.Values)
            {
                item?.Cleanup();
            }

            _contextMapping.Clear();
        }