This class provides a file and directory-based implementation
of the ICogDatabase interface.
Inheritance Hierarchy
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: 65.1.0.0 (65.1.0.0)
Syntax
The CogDatabaseDirectory type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| CogDatabaseDirectory |
Construct a new instance of the CogDatabaseDirectory class.
| |
| CogDatabaseDirectory(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.
| |
| CogDatabaseDirectory(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.
| |
| CogDatabaseDirectory(SerializationInfo, StreamingContext) |
Serialization constructor for CogDatabaseDirectory. Note that,
as with the copy constructor, the resultant CogDatabaseDirectory
object is not initially connected.
|
Methods
| Name | Description | |
|---|---|---|
| Add |
Add the supplied record to the database with a key defined
by the RecordKey field. This key must be unique.
| |
| Clear |
Remove any and all database items. Does not affect the Metadata
property.
| |
| Connect |
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.
| |
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
| Disconnect |
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.
| |
| Dispose |
Dispose of this CogDatabaseDirectory object.
| |
| Dispose(Boolean) |
Dispose of this object.
| |
| Equals | (Inherited from Object.) | |
| Fetch(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.
| |
| Fetch(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.
| |
| Finalize |
Finalize this CogDatabaseDirectory object.
(Overrides Object Finalize .) | |
| GetAttributes |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetClassName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetComponentName |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetConverter |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetCount |
Get the number of items in the currently connected database.
| |
| GetDefaultEvent |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetDefaultProperty |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEditor |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEnumerator |
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.
| |
| GetEvents |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetEvents( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
| GetKeys |
Generate an array of strings corresponding to the keys in the database.
| |
| GetKeysNoSort |
Generate an array of strings corresponding to the keys in the database.
| |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| GetObjectData |
Implements the GetObjectData method of the ISerializable interface.
(Inherited from CogSerializableObjectBase.) | |
| GetProperties |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetProperties( Attribute ) |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetPropertyOwner |
Implements the corresponding member of the ICustomTypeDescriptor interface.
May be overridden in derived classes to provide custom type information.
(Inherited from CogObjectBase.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
| OnAdded |
Raise the Added event.
| |
| OnAdding |
Raise the Adding event.
| |
| OnChanged(Int64) |
This method should be called internally whenever the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) | |
| OnChanged(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.) | |
| OnCleared |
Raise the Cleared event.
| |
| OnClearing |
Raise the Clearing event.
| |
| OnRemoved |
Raise the Removed event.
| |
| OnRemoving |
Raise the Removing event.
| |
| OnReplaced |
Raise the Replaced event.
| |
| OnReplacing |
Raise the Replacing event.
| |
| Remove(Int32) |
Remove the specified item from the database.
| |
| Remove(String) |
Remove the specified item from the database.
| |
| Replace |
Find the database item whose key matches the RecordKey of the
supplied ICogRecord. Replace that database item with
(the contents of) the supplied ICogRecord.
| |
| ResumeAndRaiseChangedEvent |
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.) | |
| SuspendChangedEvent |
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.) | |
| ToString | (Inherited from Object.) |
Fields
| Name | Description | |
|---|---|---|
| SfConnected |
This bit will be set in the EventArgs of a Changed event every
time the value returned by Connected may have changed.
| |
| SfGetCount |
This bit will be set in the EventArgs of a Changed event every
time the value returned by GetCount may have changed.
| |
| SfGetKeys |
This bit will be set in the EventArgs of a Changed event every
time the value returned by GetKeys may have changed.
| |
| SfName |
This bit will be set in the EventArgs of a Changed event every
time the value returned by Name may have changed.
| |
| SfNextSf |
Properties
| Name | Description | |
|---|---|---|
| ChangedEventSuspended |
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.) | |
| Connected |
Is this object connected to a specific database?
| |
| HasChanged | (Inherited from CogSerializableChangedEventBase.) | |
| Metadata |
Gets or sets the metadata associated with this database.
| |
| Name |
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.
| |
| StateFlags |
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.) |
Events
| Name | Description | |
|---|---|---|
| Added |
Raised after an item is added to a database.
| |
| Adding |
Raised before an item is added to a database.
| |
| Changed |
This event is raised when one or more parts of the object's state may
have changed.
(Inherited from CogSerializableChangedEventBase.) | |
| Cleared |
Raised after a database is cleared.
| |
| Clearing |
Raised before a database is cleared.
| |
| Removed |
Raised after an item is removed from a database.
| |
| Removing |
Raised before an item is removed from a database.
| |
| Replaced |
Raised after an item in a database has been replaced.
| |
| Replacing |
Raised before an item in a database is replaced.
|
See Also