Visual Basic (Declaration) | |
---|---|
Public Class CommandManager |
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 Command.UndoSupport and / or CommandRange.UndoFlags properties.
- Override the Command.Undo method (not required with CommandRange which includes built-in support with CommandRange.UndoFlags).
- Override the Command.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: x86 and x64 versions of Windows 2000, Windows XP, Windows Vista, Windows 7, Windows Server 2003 (including R2) and Windows Server 2008 (including R2). SpreadsheetGear 2009 requires the Microsoft .NET Framework 2.0 and supports .NET 3.0 and .NET 3.5.
Assembly: SpreadsheetGear (in SpreadsheetGear.dll)