C# | |
---|---|
public class CommandManager |
C# | Copy Code |
---|---|
/* |
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 Vista, Windows XP, Windows Server 2008, Windows Server 2003, Windows 2000, Windows Me and Windows 98, including 32 bit and 64 bit editions where applicable. SpreadsheetGear for .NET 1.x requires the Microsoft .NET Framework 1.1 or .NET 2.0 (works with .NET 3.x). SpreadsheetGear for .NET 2007 requires the Microsoft .NET Framework 2.0 (works with .NET 3.x).
Assembly: SpreadsheetGear (in SpreadsheetGear.dll)