示例#1
0
        public void StoreCurrentPage(string action)
        {
            if (_page != null)
            {
                _history.PushPage(new TerrainPage(_page), action);
            }
            else
            {
                _history.PushPage(null, action);
            }

            _redoHistory.ClearHistory();
        }
示例#2
0
        /// <summary>
        /// Restores the last TerrainPage pushed onto the history stack.
        /// </summary>
        public void UndoLastPageAction()
        {
            if (_history.PageHistoryCount > 0)
            {
                if (_page != null)
                {
                    _redoHistory.PushPage(new TerrainPage(_page), _history.LastPageAction());
                }
                else
                {
                    _redoHistory.PushPage(null, _history.LastPageAction());
                }

                _page = _history.PopPage();
                RefreshIndexBuffer();

                if (_page != null)
                {
                    _page.TerrainPatch.RefreshBuffers = true;
                }
            }
        }