CogUserTool ClassCognex VisionPro
A base class for tools that have a collection of other tools.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    System.ComponentModel Component
      Cognex.VisionPro.Implementation CogComponentBase
        Cognex.VisionPro.Implementation CogSerializableComponentBase
          Cognex.VisionPro.Implementation CogSerializableChangedEventComponentBase
            Cognex.VisionPro.Implementation CogToolBase
              Cognex.VisionPro.Implementation.Internal CogUserTool
                Cognex.VisionPro.ToolGroup CogToolGroup

Namespace: Cognex.VisionPro.Implementation.Internal
Assembly: Cognex.VisionPro.ToolGroup (in Cognex.VisionPro.ToolGroup.dll) Version: 65.1.0.0 (65.1.0.0)
Syntax

[SerializableAttribute]
public class CogUserTool : CogToolBase, 
	ISupportInitialize, IDeserializationCallback

The CogUserTool type exposes the following members.

Constructors

  NameDescription
Public methodCogUserTool 
Constructs a new instance of the CogUserTool class.
Public methodCogUserTool(CogUserTool)
Constructs a new instance of the CogUserTool class.
Protected methodCogUserTool(SerializationInfo, StreamingContext)
Constructs a new instance of the CogUserTool class.
Top
Methods

  NameDescription
Protected methodAddCompositeLastRunRecord
Adds all of the contained tools' last run records to the supplied record.
Public methodAddGraphicToRunRecord
Should only be called from tool group script. Adds a graphic to a specified run record.
Protected methodAddSharedGraphics
Shares all graphics between image records with the same space tree in the passed ICogRecord
Public methodBeginInit
Signals the object that initialization is starting.
Protected methodCheckRunConditions
Check for run conditions including data binding.
(Inherited from CogToolBase.)
Protected methodCheckRunConditionsNoThrow
Check for run conditions including data binding, returning an exception for the first problem encountered.
(Inherited from CogToolBase.)
Protected methodClone
Creates a deep copy of the user tool.
(Overrides CogToolBase Clone .)
Public methodCreateCurrentRecord
Creates a new set of records that represents the tool's current state.
(Inherited from CogToolBase.)
Public methodCreateLastRunRecord
Creates a new set of records that represents the tool's last-run state.
(Inherited from CogToolBase.)
Public methodCreateNewScript
Cognex internal use only.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDefineScriptTerminal(Object, String, Boolean)
Called from a script's initialize() funciton to define a tool group terminal associated with the script.
Public methodDefineScriptTerminal(String, Object, String, Boolean)
Called from a script's initialize() funciton to define a tool group terminal associated with the script.
Public methodDispose 
Releases all resources used by the Component.
(Inherited from Component.)
Protected methodDispose(Boolean)
Releases the resources used by the CogUserTool instance.
(Overrides Component Dispose(Boolean).)
Public methodEditExistingScript
Cognex internal use only.
Public methodEndInit
Signals the object that initialization is complete.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
(Inherited from Component.)
Public methodFindRunRecord
Finds a specific run record in a tree of run records
Public methodStatic memberGetAllTools
Protected methodGetAttributes
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetClassName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetComponentName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Public methodStatic memberGetContainedDataBindings(ICogTool)
Cognex Internal Use Only.
Public methodStatic memberGetContainedDataBindings(ICogTool, ICogTool)
Cognex Internal Use Only.
Protected methodGetConverter
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetDefaultEvent
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetDefaultProperty
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Public methodStatic memberGetDisabledSubTools
Returns the publicly visible collection of disabled tools.
Protected methodGetEditor
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetEvents 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetEvents( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetObjectData (Overrides CogSerializableComponentBase GetObjectData(SerializationInfo, StreamingContext).)
Protected methodGetProperties 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetProperties( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetPropertyOwner
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogComponentBase.)
Protected methodGetScriptData
Public methodGetScriptTerminalData(String)
Retrieves the data associated with a terminal. Can be called on both input and output terminals.
Public methodGetScriptTerminalData(String, Object )
Retrieves the data associated with a terminal. Can be called on both input and output terminals.
Protected methodGetService
Returns an object that represents a service provided by the Component or by its Container.
(Inherited from Component.)
Public methodStatic memberGetSubTools
Returns the publicly visible collection of tools.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodInternalCreateCurrentRecord
Called by the CreateCurrentRecord method to create a record containing the current state of the tool.
(Overrides CogToolBase InternalCreateCurrentRecord(ICogRecord, Int32).)
Protected methodInternalCreateLastRunRecord
Called by the CreateLastRunRecord method to create a record containing the state of the tool after the last call to its Run method.
(Overrides CogToolBase InternalCreateLastRunRecord(ICogRecord, Int32, Int32).)
Protected methodInternalRun
Called by the Run method to perform the main processing of the tool.
(Overrides CogToolBase InternalRun(String ).)
Public methodStatic memberIsOrIsDescendentOf(CogToolCollection, ICogTool)
Determines if a tool or one of its descendents ownes a specific scope.
Public methodStatic memberIsOrIsDescendentOf(ICogTool, ICogTool)
Public methodStatic memberIsOrIsDescendentOf(ICogTool, ICogTool, Boolean)
Determines if a tool is the same as or is contained by another tool or one of the other tool's descendents.
Protected methodMemberwiseClone 
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Protected methodOnChanged(Int64)
This method should be called internally whenever the object's state may have changed.
(Inherited from CogSerializableChangedEventComponentBase.)
Protected methodOnChanged(CogChangedEventArgs)
This method may be called internally whenever a derived object's state may have changed and the derived object expresses this change via a derived CogChangedEventArgs class.
(Inherited from CogSerializableChangedEventComponentBase.)
Public methodOnDeserialization
Runs when the entire object graph has been deserialized.
(Overrides CogToolBase OnDeserialization(Object).)
Protected methodOnRan
Raises the Ran event.
(Inherited from CogToolBase.)
Protected methodOnRunning
Raises the Running event.
(Inherited from CogToolBase.)
Protected methodPurgeOldScript
Public methodStatic memberRemoveAnonymousDatabindings(ICogTool)
Cognex Internal Use Only.
Public methodStatic memberRemoveAnonymousDatabindings( ICogTool )
Cognex Internal Use Only.
Public methodStatic memberRemoveAnonymousDatabindings(ICogTool, ICogTool)
Cognex Internal Use Only.
Public methodStatic memberRemoveAnonymousDatabindings(ICogTool,  ICogTool )
Cognex Internal Use Only.
Public methodResumeAndRaiseChangedEvent
Re-enables raising of the Changed event after SuspendChangedEvent has been called, and raises the Changed event if the ChangedEventSuspended count is reduced to zero and any changes were made while events were suspended. Must be called once for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventComponentBase.)
Public methodRun
Runs the tool. This method is guaranteed to not throw an exception. Any exception generated in the course of running the tool will be caught and packaged in the tool's RunStatus.Exception. Should this occur, the tool's RunStatus.Result will be set to Error and its RunStatus.Message will reference the message that accompanied the exception. It is the user's responsibility to examine the tool's RunStatus after calling Run.
(Inherited from CogToolBase.)
Public methodRunTool
Should only be called from tool group script. Runs a single tool. Will not run the tool if it is currently disabled.
Protected methodScriptRefeshRequested
Allows a derived class to be notified when a user requests the auto-genereated portion of the script to be refreshed.
Protected methodSetRunStatus
Cognex Internal use only.
(Inherited from CogToolBase.)
Public methodSetScriptTerminalData
Sets the data associated with a terminal.
Public methodSuspendChangedEvent
Temporarily suspends the raising of the Changed event. May be called more than once, and a corresponding call to ResumeAndRaiseChangedEvent must be made for each call to SuspendChangedEvent.
(Inherited from CogSerializableChangedEventComponentBase.)
Protected methodTool_Changed
Called when one of the contained tools raises its Changed event.
Protected methodTools_Clearing
Public methodToString
Returns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from Component.)
Top
Fields

  NameDescription
Protected fieldCurrentRecordEnable_
Gets or sets the flags specifying the records to include based on the tool's current state. The derived class exposes this as a strongly- typed enum property.
(Inherited from CogToolBase.)
Protected fieldLastRunLastRunRecordDiagEnable_
Gets or sets the flags specifying the records to create during the next invocation of the Run method.
(Inherited from CogToolBase.)
Protected fieldLastRunRecordDiagEnable_
Gets or sets the flags specifying the diagnostics records to include based on the tool's last-run state. The derived class exposes this as a strongly-typed enum property.
(Inherited from CogToolBase.)
Protected fieldLastRunRecordEnable_
Gets or sets the flags specifying the records to include based on the tool's last-run state. The derived class exposes this as a strongly- typed enum property.
(Inherited from CogToolBase.)
Protected fieldProcessingTimeAdjustment_
Gets or sets the amount to offset reported tool processing time.
(Inherited from CogToolBase.)
Public fieldStatic memberSfAbortRunOnToolFailure
State flag for the AbortRunOnToolFailure property.
Public fieldStatic memberSfLastRunRecordEnable
State flag for the LastRunRecordEnable property.
Protected fieldStatic memberSfNextSf
Next state flag to be used in derived classes.
Public fieldStatic memberSfScript
State flag for the Script property.
Top
Properties

  NameDescription
Public propertyAbortRunOnToolFailure
Gets or sets a flag indicating if the Run invocation should abort if the Run method of any of its contained tools fails.
Protected propertyAllTools
All the Tools owned by this user tool, includes tools that aren't part of the main tools collection but are still tools owned by this user tool... like ToolBlock Inputs and Outputs.
Protected propertyCanRaiseEvents
Gets a value indicating whether the component can raise an event.
(Inherited from Component.)
Public propertyChangedEventSuspended
If nonzero, indicates that the raising of the Changed event has been suspended. This value is incremented when SuspendChangedEvent is called and decremented when ResumeAndRaiseChangedEvent is called.
(Inherited from CogSerializableChangedEventComponentBase.)
Public propertyContainer
Gets the IContainer that contains the Component.
(Inherited from Component.)
Public propertyDataBindings
Gets the data bindings for the tool.
(Inherited from CogToolBase.)
Protected propertyDesignMode
Gets a value that indicates whether the Component is currently in design mode.
(Inherited from Component.)
Protected propertyDisabledTools
Gets the collection of tools that are omitted from those run by this user tool.
Protected propertyEvents
Gets the list of event handlers that are attached to this Component.
(Inherited from Component.)
Protected propertyExtraTools
Tools that aren't part of the main tools collection but are still tools owned by this user tool... like ToolBlock Inputs and Outputs. These tools may or may not show up in main ToolTreeView.
Public propertyFailOnInvalidDataBinding
Specifies that the Run method is to fail if executed while one or more data bindings are invalid.
(Inherited from CogToolBase.)
Public propertyHasChanged (Inherited from CogSerializableChangedEventComponentBase.)
Public propertyLastRunRecordEnable
Enable creation of records by bitwise ORing the appropriate CogUserToolLastRunRecordConstants.
Public propertyName
Gets or sets a user-supplied name for the tool.
(Inherited from CogToolBase.)
Public propertyRunStatus
Gets general information about the last call to the tool's Run function. Note that serious errors that occur within the tool's Run method may only be detected by examining the RunStatus after calling Run. It is the user's responsibility to examine the tool's RunStatus after calling Run.
(Inherited from CogToolBase.)
Public propertyScript
Cognex Internal Use Only.
Public propertyScriptError
Cognex Internal Use Only.
Public propertySite
Gets or sets the ISite of the Component.
(Inherited from Component.)
Public propertyStateFlags
Returns the complete set of state flags supported on this object. The flags may be indexed by name as shown in the following C# code snippet: if (changedObject.StateFlags["Color"] & eventArgs.StateFlags) { ... }
(Inherited from CogSerializableChangedEventComponentBase.)
Protected propertyTools
Gets the collection of tools within this user tool.
Public propertyUserData
Gets a CogDictionary object that can be used to store application-specific information.
(Inherited from CogToolBase.)
Top
Events

  NameDescription
Public eventChanged
This event is raised when one or more parts of the object's state may have changed.
(Inherited from CogSerializableChangedEventComponentBase.)
Public eventDisposed
Occurs when the component is disposed by a call to the Dispose  method.
(Inherited from Component.)
Public eventRan
Event that is raised at the end of the tool's Run method.
(Inherited from CogToolBase.)
Public eventRunning
Event that is raised at the start of the tool's Run method.
(Inherited from CogToolBase.)
Top
See Also