C# | |
---|---|
public class CommandManager |
C# | ![]() |
---|---|
/* |
Each workbook set is associated with one instance of CommandManager. This association is established when the CommandManager constructor is called.
To create a custom undoable command:
- Create a custom command by subclassing Command or CommandRange.
- Override the UndoSupport and / or UndoFlags properties.
- Override the Undo method (not required with CommandRange which includes built-in support with UndoFlags).
- Override the Execute method.
- Create and execute the command:
CommandCustom command = new CommandCustom();
workbookView1.ActiveCommandManager.Execute(command);
To override the behavior of an existing command:
- Create a new command manager by subclassing CommandManager.
- Override any of the methods which create default commands, such as CreateCommandPaste, and return the command you wish to execute. This can be an existing command with different options, a custom command with your own implementation, or null if you wish to disable the command.
- Instantiate your subclass of CommandManager which will make it the default command manager of the specified workbook set.
SpreadsheetGear.Windows.Forms.CommandManager
Requirements
Namespace: SpreadsheetGear.Windows.Forms
Platforms: Windows 98, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family. SpreadsheetGear for .NET 1.x requires the Microsoft .NET Framework 1.1 or 2.0. SpreadsheetGear for .NET 2006 requires the Microsoft .NET Framework 2.0.
Assembly: SpreadsheetGear (in SpreadsheetGear.dll)