📄 genericundoredo.xml
字号:
Creates <see cref="T:GenericUndoRedo.UndoRedoHistory`1"/> with given capacity.
</summary>
<param name="subject"></param>
<param name="capacity"></param>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.BeginCompoundDo">
<summary>
Begins a complex memento for grouping.
</summary>
<remarks>
From the time this method is called till the time
<see cref="M:GenericUndoRedo.UndoRedoHistory`1.EndCompoundDo"/> is called, all the <i>DO</i> actions (by calling
<see cref="M:GenericUndoRedo.UndoRedoHistory`1.Do(GenericUndoRedo.IMemento{`0})"/>) are added into a temporary
<see cref="T:GenericUndoRedo.CompoundMemento`1"/> and this memnto will be pushed into the undo
stack when <see cref="M:GenericUndoRedo.UndoRedoHistory`1.EndCompoundDo"/> is called.
<br/>
If this method is called, it's programmer's responsibility to call <see cref="M:GenericUndoRedo.UndoRedoHistory`1.EndCompoundDo"/>,
or else this history will be in incorrect state and stop functioning.
<br/>
Sample Code:
<br/>
<code>
// Version 1: Without grouping
UndoRedoHistory<Foo> history = new UndoRedoHistory<Foo>();
history.Clear();
history.Do(memento1);
history.Do(memento2);
history.Do(memento3);
// history has 3 actions on its undo stack.
// Version 1: With grouping
history.BeginCompoundDo(); // starting grouping
history.Do(memento1);
history.Do(memento2);
history.Do(memento3);
hisotry.EndCompoundDo(); // must be called to finish grouping
// history has only 1 action on its undo stack instead 3.
// This single undo action will undo all actions memorized by memento 1 to 3.
</code>
</remarks>
<exception cref="T:System.InvalidOperationException">
Thrown if previous grouping wasn't ended. See <see cref="M:GenericUndoRedo.UndoRedoHistory`1.EndCompoundDo"/>.
</exception>
<seealso cref="M:GenericUndoRedo.UndoRedoHistory`1.EndCompoundDo"/>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.EndCompoundDo">
<summary>
Ends grouping by pushing the complext memento created by <see cref="M:GenericUndoRedo.UndoRedoHistory`1.BeginCompoundDo"/> into the undo stack.
</summary>
<remarks>
For details on how <i>grouping</i> works, see <see cref="M:GenericUndoRedo.UndoRedoHistory`1.BeginCompoundDo"/>.
</remarks>
<exception cref="T:System.InvalidOperationException">
Thrown if grouping wasn't started. See <see cref="M:GenericUndoRedo.UndoRedoHistory`1.BeginCompoundDo"/>.
</exception>/// <seealso cref="M:GenericUndoRedo.UndoRedoHistory`1.BeginCompoundDo"/>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.Do(GenericUndoRedo.IMemento{`0})">
<summary>
Pushes an memento into the undo stack, any time the state of <see cref="F:GenericUndoRedo.UndoRedoHistory`1.subject"/> changes.
</summary>
<param name="m"></param>
<remarks>
This method MUST be properly involked by programmers right before (preferably) or right after
the state of <see cref="F:GenericUndoRedo.UndoRedoHistory`1.subject"/> is changed.
Whenever <see cref="M:GenericUndoRedo.UndoRedoHistory`1.Do(GenericUndoRedo.IMemento{`0})"/> is called, the status of <see cref="P:GenericUndoRedo.UndoRedoHistory`1.InUndoRedo"/>
should aways be checked first. See details at <see cref="P:GenericUndoRedo.UndoRedoHistory`1.InUndoRedo"/>.
This method causes redo stack to be cleared.
</remarks>
<seealso cref="P:GenericUndoRedo.UndoRedoHistory`1.InUndoRedo"/>
<seealso cref="M:GenericUndoRedo.UndoRedoHistory`1.Undo"/>
<seealso cref="M:GenericUndoRedo.UndoRedoHistory`1.Redo"/>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1._Do(GenericUndoRedo.IMemento{`0})">
<summary>
Internal <b>DO</b> action with no error checking
</summary>
<param name="m"></param>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.Undo">
<summary>
Restores the subject to the previous state on the undo stack, and stores the state before undoing to redo stack.
Method <see cref="P:GenericUndoRedo.UndoRedoHistory`1.CanUndo"/> can be called before calling this method.
</summary>
<seealso cref="M:GenericUndoRedo.UndoRedoHistory`1.Redo"/>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.Redo">
<summary>
Restores the subject to the next state on the redo stack, and stores the state before redoing to undo stack.
Method <see cref="P:GenericUndoRedo.UndoRedoHistory`1.CanRedo"/> can be called before calling this method.
</summary>
<seealso cref="M:GenericUndoRedo.UndoRedoHistory`1.Undo"/>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.Clear">
<summary>
Clear the entire undo and redo stacks.
</summary>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.PeekUndo">
<summary>
Gets, without removing, the top memento on the undo stack.
</summary>
<returns></returns>
</member>
<member name="M:GenericUndoRedo.UndoRedoHistory`1.PeekRedo">
<summary>
Gets, without removing, the top memento on the redo stack.
</summary>
<returns></returns>
</member>
<member name="P:GenericUndoRedo.UndoRedoHistory`1.InUndoRedo">
<summary>
Gets a value indicating if the history is in the process of undoing or redoing.
</summary>
<remarks>
This property is extremely useful to prevent undesired "Do" being executed.
That could occur in the following scenario:
event X causees a Do action and certain Undo / Redo action causes event X,
i.e. Undo / Redo causes a Do action, which will render history in a incorrect state.
So whenever <see cref="M:GenericUndoRedo.UndoRedoHistory`1.Do(GenericUndoRedo.IMemento{`0})"/> is called, the status of <see cref="P:GenericUndoRedo.UndoRedoHistory`1.InUndoRedo"/>
should aways be checked first. Example:
<code>
void SomeEventHandler()
{
if(!history.InUndoRedo)
history.Do(...);
}
</code>
</remarks>
</member>
<member name="P:GenericUndoRedo.UndoRedoHistory`1.UndoCount">
<summary>
Gets number of undo actions available
</summary>
</member>
<member name="P:GenericUndoRedo.UndoRedoHistory`1.RedoCount">
<summary>
Gets number of redo actions available
</summary>
</member>
<member name="P:GenericUndoRedo.UndoRedoHistory`1.SupportRedo">
<summary>
Gets or sets whether the history supports redo.
</summary>
</member>
<member name="P:GenericUndoRedo.UndoRedoHistory`1.CanUndo">
<summary>
Checks if there are any stored state available on the undo stack.
</summary>
</member>
<member name="P:GenericUndoRedo.UndoRedoHistory`1.CanRedo">
<summary>
Checks if there are any stored state available on the redo stack.
</summary>
</member>
</members>
</doc>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -