Custom Object Command

The ChuckThe Chuck Posts: 78 admin

Custom Object Command

An Object Command is an action which can be performed on a specific type of object.  Object Commands can be executed manually by users or automatically during a Batch Process using the Execute activity.

Custom Object Commands inherit from the base class ObjectCommand(Of ObjectType) or one of the variants listed below.  ObjectType should be replaced with the type of Grooper object that the Object Command is designed to execute against. 
In the above example, the object command SortChildren would be used with Grooper batch folders.

Mandatory Overrides

  • Execute:  Execute contains the code that will be executed against the select object.  The ObjectType of the Execute parameter must match the ObjectType specified in the ObjectCommand(Of ObjectType) inheritance.

Optional Overrides

  • CanExecute:  Returns a boolean value indicating whether or not the object command can be executed.  For example, it might verify that a batch folder has children before allowing it to perform the Sort Children command.
  • AllowMultiSelect:  Specifies whether the command should be enabled when multiple items are selected.
  • AllowPartialExecute:  When Partial Execute is set to true, the command will be enabled if CanExecute() returns true for any of the selected items.  Otherwise, the command will only be enabled if CanExecute() returns true for all selected items.

Attributes

  • Keys():  Used to set shortcut keys for the command.  For example:  Keys(Keys.Control Or Keys.O)
  • SkipConfirmation:  Instructs Grooper not to display a confirmation dialog box before executing the object command.  If not specified, a confirmation dialog will only be displayed if the command has viewable, writeable properties.

Variations

  • UICommand:  Used for commands that execute in a UI.
  • MultiUICommand:  Used for commands that execute in a UI and need to operate on the full sequence of selected items.
  • ControlCommand:  Used for commands that apply to a specific type within the context of a Grooper control.
  • MultiControlCommand:  Used for commands that apply to a specific type within the context of a Grooper control and need to operate on the full sequence of selected objects.

See Also:

Custom Templates
Properties
Attributes
Optional Overrides
Tagged:
Sign In or Register to comment.