void UndoRedoImpl(UndoRedoCommand command) { if (command.CmdOperation == UndoRedoCommand.Operation.Undo) { CurrentWorkspace.Undo(); } else if (command.CmdOperation == UndoRedoCommand.Operation.Redo) { CurrentWorkspace.Redo(); } }
void UndoRedoImpl(UndoRedoCommand command) { switch (command.CmdOperation) { case UndoRedoCommand.Operation.Undo: CurrentWorkspace.Undo(); break; case UndoRedoCommand.Operation.Redo: CurrentWorkspace.Redo(); break; } }
/// <summary> /// Undoes the check out. /// </summary> /// <param name="items">The items.</param> /// <remarks>Documented by CFI, 2010-07-14</remarks> public void UndoCheckOut(List <PendingChange> items) { bool oldValue = PluginBase.Settings.AutoReloadModifiedFiles; PluginBase.Settings.AutoReloadModifiedFiles = true; CurrentWorkspace.Undo(items.ToArray()); items.ForEach(delegate(PendingChange change) { if (change.IsAdd) { foreach (ITabbedDocument document in PluginBase.MainForm.Documents) { if (change.LocalItem == document.FileName) { document.Close(); } } Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(change.LocalItem, Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin); } }); foreach (ITabbedDocument document in PluginBase.MainForm.Documents) { if (items.FirstOrDefault(c => c.LocalItem == document.FileName) != null) { document.Reload(false); } } pluginUI.UpdatePendingChanges(); Thread resetThread = new Thread(new ThreadStart(delegate() { Thread.Sleep((int)PluginBase.Settings.GetType().GetProperty("FilePollInterval").GetValue(PluginBase.Settings, null) + 250); PluginBase.Settings.AutoReloadModifiedFiles = oldValue; })); resetThread.IsBackground = true; resetThread.Name = "Reset AutoLoad"; resetThread.Priority = ThreadPriority.Lowest; resetThread.Start(); }