Class GridTransactionCommand
Holds a collection of SyncfusionCommand objects that should all be executed together as one command when the Undo() or Redo() of a grid CommandStack is called.
Namespace: Syncfusion.Windows.Controls.Grid
Assembly: Syncfusion.Grid.Wpf.dll
Syntax
public class GridTransactionCommand : SyncfusionCommand
Remarks
The BeginTrans(String) of a CommandStack object will create a GridTransactionCommand object and redirect subsequent commands into the current GridTransactionCommand object until CommitTrans() is called.
Constructors
GridTransactionCommand(GridModelCommandManager)
Initializes a new GridTransactionCommand object and associates it with a GridModelCommandManager.
Declaration
public GridTransactionCommand(GridModelCommandManager commandStack)
Parameters
Type | Name | Description |
---|---|---|
GridModelCommandManager | commandStack | The GridModelCommandManager this command should be executed on. |
GridTransactionCommand(GridModelCommandManager, String)
Initializes a new GridTransactionCommand object and associates it with a GridModelCommandManager and sets a description text.
Declaration
public GridTransactionCommand(GridModelCommandManager commandStack, string s)
Parameters
Type | Name | Description |
---|---|---|
GridModelCommandManager | commandStack | The GridModelCommandManager this command should be executed on. |
System.String | s | The description text for this command. |
Properties
Description
Gets a description for the command.
Declaration
public override string Description { get; }
Property Value
Type |
---|
System.String |
Overrides
Stack
Gets a reference to the stack with all commands that belong to this transaction.
Declaration
public Stack Stack { get; }
Property Value
Type |
---|
System.Collections.Stack |
Methods
Execute()
Executes the command.
Declaration
public override void Execute()
Overrides
Peek()
Returns a reference to the latest command in the stack and leaves the command on the stack.
Declaration
public SyncfusionCommand Peek()
Returns
Type | Description |
---|---|
SyncfusionCommand | A reference to the latest SyncfusionCommand command. |
Pop()
Returns a reference to the latest command in the stack and removes the command from the stack.
Declaration
public SyncfusionCommand Pop()
Returns
Type | Description |
---|---|
SyncfusionCommand | A reference to the latest SyncfusionCommand command. |
Push(SyncfusionCommand)
Adds a new command to the current transaction.
Declaration
public void Push(SyncfusionCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
SyncfusionCommand | cmd | The Command. |