/// <summary>Start command. Any data changes must be done within a command.</summary> /// <param name="commandCaption"></param> /// <returns>Interface that allows properly finish the command with 'using' statement</returns> public static IDisposable Start() { return(DefaultArea.Start()); }
/// <summary>Undo last command from history list</summary> public static void Undo() { DefaultArea.Undo(); }
/// <summary> /// Repeats command that was undone before /// </summary> public static void Redo() { DefaultArea.Redo(); }
public static void Log(string message) { DefaultArea.WriteLog(message); }
internal static void ClearLog() { DefaultArea.ClearLog(); }
public static string GetLog() { return(DefaultArea.GetLog()); }
/// <summary> /// Clears all history. It does not affect current data but history only. /// It is usefull after any data initialization if you want forbid user to undo this initialization. /// </summary> public static void ClearHistory() { DefaultArea.ClearHistory(); }
/// <summary> /// Rollback current command. It does not saves any changes done in current command. /// </summary> public static void Cancel() { DefaultArea.Cancel(); }
/// <summary>Commits current command and saves changes into history</summary> public static void Commit(string caption) { DefaultArea.Commit(caption); }
/// <summary> /// Start invisible command. /// Any data changes must be done within a command. /// This command will never appear in the history. /// It will be undone/redone in bundle with previous visible command.</summary> /// <param name="commandCaption"></param> /// <returns>Interface that allows properly finish the command with 'using' statement</returns> /// <remarks><para> /// Invisible commands are useful if you need to do some changes by some event /// but do not expose them to user as a standalone command. </para> /// <para>For example, when user clicks on object, we could change SelectedObject property. /// However, it is redundant to show this operation in history and allow to undo/redo it as a valuable command. /// Instead of that, we can start invisible command and its results will be joined to previous command. /// Thus, when the previuos command will be undone, the selection will be undone too. /// </remarks> public static IDisposable StartInvisible(string commandCaption) { return(DefaultArea.StartInvisible(commandCaption)); }