CogDatabaseDirectory ClassCognex VisionPro 9.21 SR1
This class provides a file and directory-based implementation of the ICogDatabase interface.
Inheritance Hierarchy

System Object
  System MarshalByRefObject
    Cognex.VisionPro.Implementation CogObjectBase
      Cognex.VisionPro.Implementation CogSerializableObjectBase
        Cognex.VisionPro.Implementation CogSerializableChangedEventBase
          Cognex.VisionPro.Database CogDatabaseDirectory

Namespace: Cognex.VisionPro.Database
Assembly: Cognex.VisionPro.Database (in Cognex.VisionPro.Database.dll) Version: 85.1.0.0 (85.1.0.0)
Syntax

[SerializableAttribute]
public class CogDatabaseDirectory : CogSerializableChangedEventBase, 
	ICogDatabase, IEnumerable<ICogRecord>, IEnumerable, IDisposable

The CogDatabaseDirectory type exposes the following members.

Constructors

  NameDescription
Public methodCogDatabaseDirectory 
Construct a new instance of the CogDatabaseDirectory class.
Public methodCogDatabaseDirectory(String)
Construct a new instance of the CogDatabaseDirectory class. Set the Name property to the supplied value, and then attempt to connect to that database.
Public methodCogDatabaseDirectory(CogDatabaseDirectory)
Construct a new instance of the CogDatabaseDirectory class with the Name field set to match that of the supplied argument. Note that the resulting CogDatabaseDirectory object is not initially connected, regardless of the state of the argument.
Protected methodCogDatabaseDirectory(SerializationInfo, StreamingContext)
Serialization constructor for CogDatabaseDirectory. Note that, as with the copy constructor, the resultant CogDatabaseDirectory object is not initially connected.
Top
Methods

  NameDescription
Public methodAdd
Add the supplied record to the database with a key defined by the RecordKey field. This key must be unique.
Public methodClear
Remove any and all database items. Does not affect the Metadata property.
Public methodConnect
Connect to the database specified by the Name property. Successfully connecting grants exclusive read and write access to the database. This method is idempotent - you may safely call it repeatedly.
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 methodDisconnect
Disconnect from the database specified by the Name property. Successfully disconnecting releases exclusive read and write access to the database. This method is idempotent - you may safely call it repeatedly.
Public methodDispose 
Dispose of this CogDatabaseDirectory object.
Protected methodDispose(Boolean)
Dispose of this object.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFetch(Int32)
Create an ICogRecord that duplicates the item specified by the supplied index. Note that a new ICogRecord is created every time this method is called.
Public methodFetch(String)
Create an ICogRecord that duplicates the item specified by the supplied key. Note that a new ICogRecord is created every time this method is called.
Protected methodFinalize
Finalize this CogDatabaseDirectory object.
(Overrides Object Finalize .)
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.)
Public methodGetCount
Get the number of items in the currently connected database.
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
Create a strongly typed enumerator to facilitate iterating through the items in this database. Note that enumerators are fragile - externally adding or removing items from this database will invalidate the enumerator. Also note that modifying an ICogRecord returned by (the Current property of) this enumerator will have absolutely no affect on the database since it is a freshly created copy of the database item, just as with the Fetch method.
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 methodGetKeys
Generate an array of strings corresponding to the keys in the database.
Public methodGetKeysNoSort
Generate an array of strings corresponding to the keys in the database.
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 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 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 methodOnAdded
Raise the Added event.
Protected methodOnAdding
Raise the Adding event.
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
Raise the Cleared event.
Protected methodOnClearing
Raise the Clearing event.
Protected methodOnRemoved
Raise the Removed event.
Protected methodOnRemoving
Raise the Removing event.
Protected methodOnReplaced
Raise the Replaced event.
Protected methodOnReplacing
Raise the Replacing event.
Public methodRemove(Int32)
Remove the specified item from the database.
Public methodRemove(String)
Remove the specified item from the database.
Public methodReplace
Find the database item whose key matches the RecordKey of the supplied ICogRecord. Replace that database item with (the contents of) the supplied ICogRecord.
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.)
Top
Fields

  NameDescription
Public fieldStatic memberSfConnected
This bit will be set in the EventArgs of a Changed event every time the value returned by Connected may have changed.
Public fieldStatic memberSfGetCount
This bit will be set in the EventArgs of a Changed event every time the value returned by GetCount may have changed.
Public fieldStatic memberSfGetKeys
This bit will be set in the EventArgs of a Changed event every time the value returned by GetKeys may have changed.
Public fieldStatic memberSfName
This bit will be set in the EventArgs of a Changed event every time the value returned by Name may have changed.
Protected fieldStatic memberSfNextSf
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 propertyConnected
Is this object connected to a specific database?
Public propertyHasChanged (Inherited from CogSerializableChangedEventBase.)
Public propertyMetadata
Gets or sets the metadata associated with this database.
Public propertyName
Gets or sets the name of this database. This will be the path of the desired database directory, e.g. "C:\\MyDatabase". This must be set to the desired value before calling Connect. Attempting to set this when Connected is true will cause an exception to be thrown.
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.)
Top
Events

  NameDescription
Public eventAdded
Raised after an item is added to a database.
Public eventAdding
Raised before an item is added to a database.
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 a database is cleared.
Public eventClearing
Raised before a database is cleared.
Public eventRemoved
Raised after an item is removed from a database.
Public eventRemoving
Raised before an item is removed from a database.
Public eventReplaced
Raised after an item in a database has been replaced.
Public eventReplacing
Raised before an item in a database is replaced.
Top
See Also