Grooper.ObjectCommand

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.


Inherits from: Grooper.ConnectedObject

Constructors

Signature Description
New (Database As GrooperDb)
Parameters
Database
          Type: GrooperDb
          
New ()

Fields

Field Name Field Type Description
ContextInstance As System.Object System.Object
Database As Grooper.GrooperDb Grooper.GrooperDb
ipd As Grooper.IProgressDisplay Grooper.IProgressDisplay
Parent As System.Windows.Forms.IWin32Window System.Windows.Forms.IWin32Window

Properties

Property Name Property Type Description
HasReferenceProperties System.Boolean Returns true if the object has properties which reference Grooper Node objects.
IsEmpty System.Boolean Returns true if all properties with a ViewableAttribute are set to their default value.
IsWriteable System.Boolean Returns true if the object is writable, or false if it is not.
Root Grooper.GrooperRoot Returns the root node
ShowEllipses System.Boolean Specifies whether elipses (...) will be shown after the command name on context menus. By default, this property will return true if the command has configurable properties, or if the command has the RequiresUIAttribute applied. Derived classes may override this property to exercise direct control over whether ellipses will be displayed.

Methods

Method Name Description
AllCommandsOf(ObjectType As Type, ContextType As Type, RepositoryId As Guid) As IEnumerable(Of Type) Returns a consolidated list of general and context-specific commands for an object type.
Parameters
ObjectType
          Type: Type
          The object to retrieve commands for.
 
ContextType
          Type: Type
          The Context to retrieve commands for.
 
RepositoryId
          Type: Guid
          The current repository ID. Necessary only when a type from an Object Library is being loaded.
CanExecuteCommand(Items As IEnumerable) As Boolean Returns true if the command can be executed on the provided list of items.
Parameters
Items
          Type: IEnumerable
          The list of item to which the command will be applied.
CanExecuteStatic(CommandType As Type, Items As IEnumerable) As Nullable(Of Boolean)
Parameters
CommandType
          Type: Type
          
 
Items
          Type: IEnumerable
          
CommandsOf(ObjectType As Type, RepositoryId As Guid, IncludeUI As Boolean) As IEnumerable(Of Type) Returns a list of commands for the specified object type.
Parameters
ObjectType
          Type: Type
          The object to retrieve commands for.
 
RepositoryId
          Type: Guid
          The current repository ID. Necessary only when a type from an Object Library is being loaded.
 
IncludeUI
          Type: Boolean
          Specifies whether command requiring a UI should be included.
CommandsOf(ObjectType As Type, ContextType As Type, RepositoryId As Guid) As IEnumerable(Of Type) Returns a list of context-specific commands for an object type.
Parameters
ObjectType
          Type: Type
          The object to retrieve commands for.
 
ContextType
          Type: Type
          The Context to retrieve commands for.
 
RepositoryId
          Type: Guid
          The current repository ID. Necessary only when a type from an Object Library is being loaded.
ExecuteCommand(Items As IEnumerable) Executes the code written in the overridden instance of ExecuteCommand.
Parameters
Items
          Type: IEnumerable
          A list of items to apply to command to.
GetApplyType(CommandType As Type) As Type
Parameters
CommandType
          Type: Type
          
GetCommandsForObject(RepositoryId As Guid, ObjectType As Type, ContextType As Type) As IEnumerable(Of Type) Returns a list of commands which apply to a specific object type.
Parameters
RepositoryId
          Type: Guid
          The GUID ID of the Grooper repository.
 
ObjectType
          Type: Type
          The object type.
 
ContextType
          Type: Type
          An optional context type.
GetCommandsForObjects(RepositoryId As Guid, ObjectTypes As IEnumerable(Of Type), ContextType As Type) As List(Of Type) Returns a list of commands which apply to the specified list of object types.
Parameters
RepositoryId
          Type: Guid
          The GUID ID of the Grooper repository.
 
ObjectTypes
          Type: IEnumerable`1
          The list of object types.
 
ContextType
          Type: Type
          An optional context type.
GetProperties() As PropertyDescriptorCollection
GetReferences() As List(Of GrooperNode) Returns a list of GrooperNode objects referenced in the properties of this object.
Initialize(gdb As GrooperDb, Parent As IWin32Window, ContextInstance As Object) Initializes the command.
Parameters
gdb
          Type: GrooperDb
          The Grooper database.
 
Parent
          Type: IWin32Window
          The parent window, or null if there is no UI.
 
ContextInstance
          Type: Object
          An optional context instance.
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently enabled.
Parameters
PropertyName
          Type: String
          The name of the property to determine the enabled state for.
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently visible.
Parameters
PropertyName
          Type: String
          The name of the property to determine the visible state for.
IsType(Type As Type) As Boolean Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters
Type
          Type: Type
          The type to check.
Run(Parent As IWin32Window, gdb As GrooperDb, CommandType As Type, Items As IEnumerable, ContextInstance As Object, AutoSave As Boolean) As Boolean Executes an ObjectCommand in a UI.
Parameters
Parent
          Type: IWin32Window
          The parent window.
 
gdb
          Type: GrooperDb
          The Grooper database.
 
CommandType
          Type: Type
          The type of the command to execute.
 
Items
          Type: IEnumerable
          The items to execute the command against.
 
ContextInstance
          Type: Object
          An optional context instance.
 
AutoSave
          Type: Boolean
          If true, the properties of the command will be saved, so that they will appears the default settings the next time the command is executed.
Run(Parent As IWin32Window, Cmd As ObjectCommand, Items As IEnumerable, AutoSave As Boolean) As Boolean Executes an ObjectCommand in a UI.
Parameters
Parent
          Type: IWin32Window
          The parent window.
 
Cmd
          Type: ObjectCommand
          The command instance to execute.
 
Items
          Type: IEnumerable
          The items to execute the command against.
 
AutoSave
          Type: Boolean
          If true, the properties of the command will be saved, so that they will appears the default settings the next time the command is executed.
Serialize() As String Serializes the object.
SetDatabase(Database As GrooperDb) Sets the database connection of the object.
Parameters
Database
          Type: GrooperDb
          
ToString() As String Returns a string value representation of the connected object.
Uninitialize() Uninitializes the command.
ValidateProperties() As ValidationErrorList Validates the properties of the object, returning a list of validation errors.