|Download Help (Windows Only)|
Use Command objects in applications to implement a user interface element that performs a standard action, such as opening a sequence file or executing a set of selected steps in a sequence. A Command object determines the dimming, visibility, shortcut key, and caption for the menu item, button, or checkbox that invokes the command. The Command object also provides the implementation of the action, which it performs when you call the Command.Execute method.
In many cases you can use a TestStand Utility Library function, such as InsertCommandsInMenu, instead of Command objects to create menu items that invoke the commands you specify. You can also call the ConnectCommand method on a TestStand manager control to connect a command to a TestStand button or checkbox control.
To create Command objects, call the ApplicationMgr.NewCommands method to create a Commands collection. You specify the commands to create with the CommandKinds enumeration constants. When you call the Commands.InsertKind method, you can also specify a TestStand manager control. A command you create uses the specified manager control to determine the currently selected sequence file, execution, sequence, or steps. According to the selection and the type of command, the command determines the state of its properties, such as enabled and visible, and determines which items the command operates on when it executes. Some commands do not require a manager control, while others require a specific manager control. Refer to the CommandKinds enumeration for more information about which manager controls work with specific commands.
You can also create commands using the following methods:
|EntryPoint (Read Only)|
|EntryPointIndex (Read Only)|
|Kind (Read Only)|