TestStand applications typically use menus, buttons, or other controls to provide commands to users. The OpenSequenceFile, ExecuteEntryPoint, RunSelectedSteps, Break, Resume, Terminate, and Exit commands are common to most TestStand applications.

The CommandKinds enumeration in the TestStand User Interface (UI) Controls API defines a set of common commands you can add to an application. You can connect these commands to TestStand buttons or application menu items, which automatically execute the command. You do not need an event handler to implement the command.

The commands also determine the menu item or button text to display according to the current language and automatically dim or enable buttons or menu items according to the state of the application. Because the TestStand UI Controls API implements many common application commands, connecting commands to buttons and menu items significantly reduces the amount of source code an application requires.

Some commands apply to the selected item in the manager control to which you connect. For example, the Break command suspends the current execution an ExecutionView Manager control selects. Other commands, such as Exit, function the same regardless of the manager control you use to connect them.

Call the following methods to connect a command to a Button or CheckBox control:

  • ApplicationMgr.ConnectCommand
  • SequenceFileViewMgr.ConnectCommand
  • ExecutionViewMgr.ConnectCommand

To invoke a command without connecting it to a control, call one of the following methods to obtain a Command object:

  • ApplicationMgr.GetCommand
  • ApplicationMgr.NewCommands
  • SequenceFileViewMgr.GetCommand
  • ExecutionViewMgr.GetCommand

After you obtain a Command object, call the Command.Execute method to invoke the command.