MindFusion.Wpf Pack Programmer's Guide
ChangeWorksheetCommand Class
Remarks See Also
 





Represents a command that can track and undo changes of a Worksheet.

Namespace: MindFusion.Spreadsheet.Wpf
Assembly: MindFusion.Spreadsheet.Wpf

 Syntax

C#  Copy Code

public class ChangeWorksheetCommand : TrackChangesCommand

Visual Basic  Copy Code

Public Class ChangeWorksheetCommand
    Inherits TrackChangesCommand

 Remarks

The ChangeWorksheetCommand can be used to track and undo worksheet changes. The ChangeWorksheetCommand class cannot be instantiated directly. To create a ChangeWorksheetCommand object, call the StartChangeOperation method of the Workbook class. After the command has been started, most modifications of the worksheet will be automatically recorded into this command. To complete the command, either call the CommitChangeOperation method of the Workbook class or the Dispose method of the command itself. To cancel the command (and revert all recorded modifications), call the CancelChangeOperation method of the Workbook class or the Cancel method of the command.

 Example

The following code changes the name and the data of an existing worksheet. Note, that due to the disposable pattern, the change command is automatically executed at the end of the using block.

C#  Copy Code

using (workbook.StartChangeOperation(worksheet))
{
    worksheet.Name = "My worksheet";
    worksheet.Cells["A1"].Data = 100;
}

Visual Basic  Copy Code

Using workbook.StartChangeOperation(worksheet)
    worksheet.Name = "My worksheet"
    worksheet.Cells("A1").Data = 100
End Using

 Inheritance Hierarchy

System.Object
    MindFusion.Spreadsheet.Wpf.Command
        MindFusion.Spreadsheet.Wpf.DisposableCommand
            MindFusion.Spreadsheet.Wpf.TrackChangesCommand
                MindFusion.Spreadsheet.Wpf.ChangeWorksheetCommand

 See Also

ChangeWorksheetCommand Members
MindFusion.Spreadsheet.Wpf Namespace