CogVisionDataContainer ClassCognex VisionPro 9.8 SR1
This class is a general purpose container of vision data. Each element in this container has both a string key and a value of type ICogVisionData. This container maintains an ordered list of these key value pairs. A particular ICogVisionData value may be referenced by integer index as in a list, or by string key as in a dictionary. The keys must all be unique, non-null, non-empty strings. In addition, this class implements the ICogVisionData interface.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro CogVisionDataContainer

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.CorePlus (in Cognex.VisionPro.CorePlus.dll) Version: 75.0.0.0
Syntax

[SerializableAttribute]
public class CogVisionDataContainer : CogSerializableChangedEventBase, 
	IList<KeyValuePair<string, ICogVisionData>>, IDictionary<string, ICogVisionData>, 
	ICogCollectionEvents, IDeserializationCallback, ICogVisionData, ICogVisionData, ICogVisionDataContainerLegacy

The CogVisionDataContainer type exposes the following members.

Constructors

  NameDescription
Public methodCogVisionDataContainer 
Default construct a CogVisionDataContainer.
Public methodCogVisionDataContainer(CogVisionDataContainer)
Copy construct a CogVisionDataContainer from the supplied container. This is a shallow copy: the values are copied not cloned.
Protected methodCogVisionDataContainer(SerializationInfo, StreamingContext)
Serialization construct a CogVisionDataContainer.
Top
Methods

  NameDescription
Public methodAdd(KeyValuePair String, ICogVisionData )
Adds the supplied key value pair to the end of the container.
Public methodAdd(String, ICogVisionData)
Adds to the end of the container a key value pair using the supplied key string and ICogVisionData value.
Public methodClear
Removes all key value pairs from the container.
Public methodContains(KeyValuePair String, ICogVisionData )
Returns true if the supplied key value pair is found, otherwise returns false.
Public methodContains(String)
Returns true if the supplied key is found, otherwise returns false.
Public methodContains(ICogVisionData)
Returns true if the supplied value is found, otherwise returns false.
Public methodContainsKey
Returns true if the specified key is found in this container, otherwise returns false.
Public methodContainsValue
Returns true if the specified value is found in this container, otherwise returns false.
Public methodCopyTo
Copies the entire collection to a one-dimensional array of key value pairs, starting at the specified index of the target array.
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 methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetAttributes
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetClassName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetComponentName
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetConverter
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultEvent
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetDefaultProperty
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEditor
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetEnumerator
Get an enumerator for this conllection of key value pairs.
Protected methodGetEvents 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetEvents( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetKey
Returns the key string associated with the specified index.
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetObjectData
Implements the GetObjectData method of the ISerializable interface.
(Inherited from CogSerializableObjectBase.)
Protected methodGetProperties 
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetProperties( Attribute )
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Protected methodGetPropertyOwner
Implements the corresponding member of the ICustomTypeDescriptor interface. May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.)
Public methodGetRangeGreyImagePairs( CogImage16Range  ,  CogImage16Grey  )
Public methodGetRangeGreyImagePairs( CogImage16Range  ,  CogImage16Grey  ,  String  )
This method steps through the top level elements in the container. For every element that is itself a container holding exactly one CogImage16Range and exactly one CogImage16Grey (and possibly some other objects), copy a reference to that range image into the output array of CogImage16Range references. And copy a reference to the grey image into the output array of CogImage16Grey. And copy the associated top level dictionary key string into the output array of string references. The output arrays may be empty. This method ignores top level elements that are not of type CogVisionDataContainer. This method ignores top level elements that contain more than one CogImage16Range or more than one CogImage16Grey.
Public methodGetRangeImages( CogImage16Range  )
Public methodGetRangeImages( CogImage16Range  ,  String  )
This method steps through the top level elements in this container and copies a reference to every CogImage16Range that it finds into an output array of CogImage16Range references. For every range image so identified, the associated dictionary key string is copied into an output array of string references. The resultant output arrays may be empty. This method ignores top level elements that are not of type CogImage16Range.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf(KeyValuePair String, ICogVisionData )
Searches the container for the specified key value pair and returns the zero-based index of the first occurrence.
Public methodIndexOf(String)
Searches the container for the key value pair with the specified key and returns its zero-based index.
Public methodIndexOf(ICogVisionData)
Searches the container for the key value pair with the specified value and returns its zero-based index.
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodInsert(Int32, KeyValuePair String, ICogVisionData )
Inserts the supplied key value pair at the specified index.
Public methodInsert(Int32, String, ICogVisionData)
Inserts a key value pair with the supplied string key and ICogVisionData value at the specified index.
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.)
Public methodMove
Moves a key value pair from one position to another.
Protected methodOnChanged(Int64)
This method should be called internally whenever the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
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 CogSerializableChangedEventBase.)
Protected methodOnCleared
Raises the Cleared event and the Changed event.
Protected methodOnClearing
Raises the Clearing event.
Public methodOnDeserialization
Perform post-deserialization tasks.
Protected methodOnInsertedItem
Raises the InsertedItem event and the Changed event.
Protected methodOnInsertingItem
Raises the InsertingItem event.
Protected methodOnMovedItem
Raises the MovedItem event and the Changed event.
Protected methodOnMovingItem
Raises the MovingItem event.
Protected methodOnRemovedItem
Raises the RemovedItem event and the Changed event.
Protected methodOnRemovingItem
Raises the RemovingItem event.
Protected methodOnReplacedItem
Raises the ReplacedItem event and the Changed event.
Protected methodOnReplacingItem
Raises the ReplacingItem event.
Public methodRemove(KeyValuePair String, ICogVisionData )
Removes the supplied key value pair from this container. Does nothing if the supplied key value pair is not found.
Public methodRemove(String)
Removes from this container the key value pair with the specified key. Does nothing if this key is not found.
Public methodRemove(ICogVisionData)
Removes from this container the key value pair with the specified value. Does nothing if this value is not found.
Public methodRemoveAt
Removes the key value pair at the specified index.
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 CogSerializableChangedEventBase.)
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 CogSerializableChangedEventBase.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodTryGetValue
If this container holds the specified key, output the associated ICogVisionData value. Return true if the key was found, otherwise return false.
Top
Fields

  NameDescription
Public fieldStatic memberSfCount
State flag for the Count property.
Public fieldStatic memberSfItem
State flag for the Item (indexer) property.
Protected fieldStatic memberSfNextSf
Next state flag to be used in derived classes.
Top
Properties

  NameDescription
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 CogSerializableChangedEventBase.)
Public propertyContainsRangeGreyImagePairsOnly
Returns true only if this collection is non-empty and all of its contained elements are Range/Grey image pairs. Otherwise, returns false. An element is a Range/Grey image pair if it is itself a CogVisionDataContainer that contains exactly one CogImage16Range and one CogImage16Grey, nothing else.
Public propertyContainsRangeImagesOnly
Returns true if:
  • The collection contains at least one element that is a CogImage16Range, and
  • The collection contains no elements that are not a CogImage16Range.
Otherwise, returns false.
Public propertyCount
Gets the number of elements in this container.
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyIsRangeGreyImagePair
Returns true if this object is a Range/Grey image pair. Otherwise, returns false. A CogVisionDataContainer is a Range/Grey image pair if contains exactly one CogImage16Range and one CogImage16Grey, nothing else.
Public propertyIsReadOnly
Returns true if this collection is ReadOnly
Public propertyItem Int32 
Public propertyItem String 
Public propertyKeys
Gets a collection of all key strings in this container.
Public propertyPairIndexer
Gets or sets the key value pair at the specified index. The key is a string and the value is an ICogVisionData reference.
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 CogSerializableChangedEventBase.)
Public propertyValues
Gets a collection of all ICogVisionData values in this container.
Top
Events

  NameDescription
Public eventChanged
This event is raised when one or more parts of the object's state may have changed.
(Inherited from CogSerializableChangedEventBase.)
Public eventCleared
Raised after the container is cleared.
Public eventClearing
Raised before the container is cleared.
Public eventInsertedItem
Raised after an item is inserted.
Public eventInsertingItem
Raised before an item is inserted.
Public eventMovedItem
Raised after an item is moved to a new index.
Public eventMovingItem
Raised before an item is moved to a new index.
Public eventRemovedItem
Raised after an item is removed.
Public eventRemovingItem
Raised before an item is removed.
Public eventReplacedItem
Raised after an item is replaced.
Public eventReplacingItem
Raised before an item is replaced.
Top
See Also