Nevron .NET Vision Documentation
Commands and Command Bars Manager

Commands are used to facilitate the implementation of any diagram user action, which can be performed from a menu, toolbar or context menu. The diagram commands implementation is not bound to the Nevron User Interface, which makes it possible to reuse them with other UI suites. All diagram commands derive from the base NDiagramCommand class. Diagram commands can, in general, be classified as follows:

Based on the operation they perform, commands are also grouped in ranges. The command ranges currently available are enumerated by the DiagramCommandRange enumeration. The commands currently implemented are enumerated by the DiagramCommand enumeration. It is important to remember that each diagram command has an id and range (exposed by the Id and RangeId properties).

Diagram Commander

The diagram commander (hereafter referred to as commander) is represented by an instance of the NDiagramCommander class. It serves as a bridge between the Nevron User Interface and the diagram commands. The commander maintains a collection of diagram commands, which is accessible from its Commands property. Initially it contains all currently implemented commands. Currently the commander can be used to control the following controls:

Diagram Command Bars Manager

The diagram command bars manager (hereafter referred to as manager) is a component, which is represented by the NDiagramCommandBarsManager class. The manager contains a commander, which is accessible from its Commander property. It also exposes the same set of control properties as the commander and naturally delegates the set implementations to the contained commander. In this way the logic behind all commands is wrapped inside the commander and the diagram commands.

The manager derives from the Nevron UI NCommandBarsManager class and, as such, is responsible for populating it with Nevron UI command contexts and command ranges. The command ranges and command contexts are recreated by Recreate method. The ranges are initialized with the values of the DiagramCommandRange enumeration, while the command contexts are populated with the Nevron UI representation of the diagram commands. The Recreate method also rebuilds the main menu and the docking toolbars.

The main menu, docking toolbars and context menu building is performed by several replaceable parts of the manager, which are responsible to create command context instances (Nevron UI commands) and that is why they are called command builders. All command builders derive from the base NCommandBuilder class. Currently available are the following command builders:

Related Examples
Windows Forms: Visual Interface Components - Command Bars
Windows Forms: Visual Interface Components - Context Menu
See Also

 

 


©2017. Nevron Software LLC.

Send Feedback