/// ----------------------------------------------------------------------------------- /// <summary> /// Set up an undo-action to replace the selection /// </summary> /// <param name="fForUndo"><c>true</c> to setup action for Undo, <c>false</c> for /// Redo.</param> /// <remarks>We want to create a UndoSelectionAction only if we are the outermost /// UndoTask.</remarks> /// ----------------------------------------------------------------------------------- private void SetupUndoSelection(bool fForUndo) { if (m_vwRootSite == null || ((Control)m_vwRootSite).IsDisposed || // has already been disposed ... tough to find... m_vwRootSite.RootBox == null) { return; } UndoSelectionAction selectionAction = new UndoSelectionAction(m_vwRootSite, fForUndo, m_vwRootSite.RootBox.Selection); m_actionHandler.AddAction(selectionAction); if (!fForUndo) { m_redoSelectionAction = selectionAction; } }
/// ----------------------------------------------------------------------------------- /// <summary> /// Set up an undo-action to replace the selection /// </summary> /// <param name="fForUndo"><c>true</c> to setup action for Undo, <c>false</c> for /// Redo.</param> /// <remarks>We want to create a UndoSelectionAction only if we are the outermost /// UndoTask.</remarks> /// ----------------------------------------------------------------------------------- private void SetupUndoSelection(bool fForUndo) { if (m_vwRootSite == null || ((Control)m_vwRootSite).IsDisposed || // has already been disposed ... tough to find... m_vwRootSite.RootBox == null) { return; } UndoSelectionAction selectionAction = new UndoSelectionAction(m_vwRootSite, fForUndo, m_vwRootSite.RootBox.Selection); m_actionHandler.AddAction(selectionAction); if (!fForUndo) m_redoSelectionAction = selectionAction; }