public void Unexecute() { // Re Add the Keyframe m_psui.OnAddKeyframe(m_iFramePosition); // Re Add all drawings on the frame // We can't add them through the CommandAddDrawing scheme, // because it completely messes up the Commands History. // Even now, Command History is quite messed up, but the user need to // go back and forth in the undo/redo to notice the problem. if (m_Keyframe.Drawings.Count > 0) { int iIndex = GetKeyframeIndex(); CommandManager cm = CommandManager.Instance(); for (int i = m_Keyframe.Drawings.Count - 1; i >= 0; i--) { // 1. Add the drawing to the Keyframe m_Metadata[iIndex].Drawings.Insert(0, m_Keyframe.Drawings[i]); // 2. Call the Command //IUndoableCommand cad = new CommandAddDrawing(m_psui, m_Metadata, m_iFramePosition); //cm.LaunchUndoableCommand(cad); } // We need to block the Redo here. // In normal behavior, we should have a "Redo : Delete Keyframe", // But here we added other commands, so we'll discard commands that are up in the m_CommandStack. // To avoid having a "Redo : Add Drawing" that makes no sense. //cm.BlockRedo(); } }
/// <summary> /// Execution de la commande /// </summary> public void Execute() { // Add a Keyframe at given position m_psui.OnAddKeyframe(m_iFramePosition); }