Class HistoryManager
Represents to customizes the undo redo functionalities.
Inheritance
Namespace: Syncfusion.UI.Xaml.Diagram
Assembly: Syncfusion.SfDiagram.UWP.dll
Syntax
public class HistoryManager : Object, IUndoRedo, INotifyPropertyChanged
Constructors
HistoryManager()
Declaration
public HistoryManager()
Properties
RedoStack
Gets the list of undo history entries.
Declaration
public Stack<HistoryEntry> RedoStack { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Stack<HistoryEntry> | The list of data that is used when performing Undo Operations. The default value is an empty list. |
Remarks
This property is used to add, remove, and modify the data in the undo list of the diagram's HistoryManager.
StackLimit
Gets or sets the numerical value that is used to limit the maximum number of history entries in the Undo and Redo stacks.
Declaration
public int StackLimit { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | This value represents the maximum number of history entries that can be stored in the undo and redo stack. The default value is 0, which means you can store an unlimited number of entries. |
State
Gets or sets state for UndoRedo.
Declaration
public UndoRedoState State { get; set; }
Property Value
Type |
---|
UndoRedoState |
UndoStack
Gets the list of undo history entries.
Declaration
public Stack<HistoryEntry> UndoStack { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Stack<HistoryEntry> | The list of data that is used when performing Undo Operations. The default value is an empty list. |
Remarks
This property is used to add, remove, and modify the data in the undo list of the diagram's HistoryManager.
Methods
BeginComposite()
Starts grouping the actions that will be undone/restored as a whole.
Declaration
public void BeginComposite()
BeginComposite(IUndoRedo, Object)
Starts grouping the actions that will be undone/restored as a whole.
Declaration
public void BeginComposite(IUndoRedo source, object data)
Parameters
Type | Name | Description |
---|---|---|
IUndoRedo | source | The instance of source. |
System.Object | data | Specified the data(Instance of CompositeTransactions with the TransactionState as start) to log in the Stack. |
CanLogData(IUndoRedo, Object)
canLog in the history list, which takes a history entry as argument and returns whether the specific entry can be added or not.
Declaration
public virtual bool CanLogData(IUndoRedo source, object data)
Parameters
Type | Name | Description |
---|---|---|
IUndoRedo | source | The instance of IUndoRedo. |
System.Object | data | Specified the data to log in the Stack. |
Returns
Type |
---|
System.Boolean |
CanRedo(Object)
Specifies a method to perform redo operation.
Declaration
public bool CanRedo(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data |
Returns
Type | Description |
---|---|
System.Boolean | Returns true, when the state as idle in redo operation. Otherwise, false. |
CanUndo(Object)
Specifies a method to perform undo operation.
Declaration
public bool CanUndo(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data |
Returns
Type | Description |
---|---|
System.Boolean | Returns true, when the state as idle in undo operation. Otherwise, false. |
EndComposite()
Closes grouping the actions that will be undone/restored as a whole
Declaration
public void EndComposite()
EndComposite(IUndoRedo, Object)
Closes grouping the actions that will be undone/restored as a whole
Declaration
public void EndComposite(IUndoRedo source, object data)
Parameters
Type | Name | Description |
---|---|---|
IUndoRedo | source | The instance of source. |
System.Object | data | Specified the data(Instance of CompositeTransactions with the TransactionState as end) to log in the Stack. |
LogData(IUndoRedo, Object)
Specifies a method to log the requied data with instance of source to stack for UndoRedo.
Declaration
public bool LogData(IUndoRedo source, object data)
Parameters
Type | Name | Description |
---|---|---|
IUndoRedo | source | The instance of IUndoRedo. |
System.Object | data | Specified the data to log in the Stack. |
Returns
Type |
---|
System.Boolean |
OnPropertyChanged(String)
Declaration
protected virtual void OnPropertyChanged(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Redo(Object)
Specifies a method to invoke when perform redo operation.
Declaration
public object Redo(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data |
Returns
Type |
---|
System.Object |
Undo(Object)
Specifies a method to invoke when perform undo operation.
Declaration
public object Undo(object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | data |
Returns
Type |
---|
System.Object |
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |