WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class HistoryTransactionCommand

    Show / Hide Table of Contents

    Class HistoryTransactionCommand

    Holds a collection of HistoryCommandBase objects that should all be executed together as one command when the SpreadsheetCommandManager.Undo or SpreadsheetCommandManager.Redo of a grid SpreadsheetCommandManager.CommandStack is called.

    Inheritance
    System.Object
    HistoryCommandBase
    HistoryTransactionCommand
    Inherited Members
    HistoryCommandBase.Range
    HistoryCommandBase.SfSpreadsheet
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.UI.Xaml.Spreadsheet.History
    Assembly: Syncfusion.SfSpreadsheet.WPF.dll
    Syntax
    public class HistoryTransactionCommand : HistoryCommandBase
    Remarks

    The SpreadsheetCommandManager.BeginTrans of a SpreadsheetCommandManager.CommandStack object will create a HistoryTransactionCommand object and redirect subsequent commands into the current HistoryTransactionCommand object until SpreadsheetCommandManager.CommitTrans is called.

    Constructors

    HistoryTransactionCommand(SfSpreadsheet, IRange[], GridCurrentCell)

    Declaration
    public HistoryTransactionCommand(SfSpreadsheet sfSpreadsheet, IRange[] ranges, GridCurrentCell currentCell)
    Parameters
    Type Name Description
    SfSpreadsheet sfSpreadsheet

    An instance of SfSpreadsheet.

    IRange[] ranges

    Specified excel ranges.

    GridCurrentCell currentCell

    Current cell in SpreadsheetGrid.

    HistoryTransactionCommand(SfSpreadsheet, IRange[], Int32, Int32, GridColumn)

    Initializes a new instance of the HistoryTransactionCommand class.

    Declaration
    public HistoryTransactionCommand(SfSpreadsheet sfSpreadsheet, IRange[] ranges, int row, int col, GridColumn column)
    Parameters
    Type Name Description
    SfSpreadsheet sfSpreadsheet

    An instance of SfSpreadsheet.

    IRange[] ranges

    Specified excel ranges.

    System.Int32 row

    Row index of the current cell.

    System.Int32 col

    Column index of the current cell.

    GridColumn column

    An instance of GridColumn.

    HistoryTransactionCommand(SfSpreadsheet, String)

    Initializes a new HistoryTransactionCommand object and associates it with a SpreadsheetCommandManager and sets a description text.

    Declaration
    public HistoryTransactionCommand(SfSpreadsheet sfSpreadsheet, string description)
    Parameters
    Type Name Description
    SfSpreadsheet sfSpreadsheet

    An instance of SfSpreadsheet.

    System.String description

    Description of the commands.

    Properties

    Description

    Gets a description for the command.

    Declaration
    public override string Description { get; }
    Property Value
    Type Description
    System.String
    Overrides
    HistoryCommandBase.Description

    Stack

    Gets a reference to the stack with all commands that belong to this transaction.

    Declaration
    public Stack<HistoryCommandBase> Stack { get; }
    Property Value
    Type Description
    System.Collections.Generic.Stack<HistoryCommandBase>

    Methods

    Execute(CommandMode)

    Executes the transaction command in SfSpreadsheet.

    Declaration
    public override void Execute(CommandMode mode)
    Parameters
    Type Name Description
    CommandMode mode

    Current transaction mode.

    Overrides
    HistoryCommandBase.Execute(CommandMode)

    Peek()

    Returns a reference to the latest command in the stack and leaves the command on the stack.

    Declaration
    public HistoryCommandBase Peek()
    Returns
    Type Description
    HistoryCommandBase

    A reference to the latest HistoryCommandBase command.

    Pop(CommandMode)

    Returns a reference to the latest command in the stack and removes the command from the stack.

    Declaration
    public HistoryCommandBase Pop(CommandMode mode)
    Parameters
    Type Name Description
    CommandMode mode
    Returns
    Type Description
    HistoryCommandBase

    A reference to the latest HistoryCommandBase command.

    Push(HistoryCommandBase)

    Adds a new command to the current transaction.

    Declaration
    public void Push(HistoryCommandBase cmd)
    Parameters
    Type Name Description
    HistoryCommandBase cmd

    The Command for the transaction.

    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved