ICogDatabase InterfaceCognex VisionPro 9.20
Interface that describes basic interactions with an ICogRecord-centric database.

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

public interface ICogDatabase : IEnumerable<ICogRecord>, 
	IEnumerable

The ICogDatabase type exposes the following members.

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 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 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.
Public methodGetCount
Get the number of items in the currently connected database.
Public methodGetEnumerator 
Returns an enumerator that iterates through the collection.
(Inherited from IEnumerable ICogRecord .)
Public methodGetEnumerator 
Returns an enumerator that iterates through a collection.
(Inherited from IEnumerable.)
Public methodGetKeys
Generate an array of strings corresponding to the keys in the database.
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.
Top
Properties

  NameDescription
Public propertyConnected
Is this object connected to a specific database?
Public propertyMetadata
Gets or sets the metadata associated with this database.
Public propertyName
Gets or sets the name of this database. 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.
Top
Events

  NameDescription
Public eventAdded
Event that is raised at the end of a call to Add.
Public eventAdding
Event that is raised at the start of a call to Add.
Public eventCleared
Event that is raised at the end of a call to Clear.
Public eventClearing
Event that is raised at the start of a call to Clear.
Public eventRemoved
Event that is raised at the end of a call to Remove.
Public eventRemoving
Event that is raised at the start of a call to Remove.
Public eventReplaced
Event that is raised at the end of a call to Replace.
Public eventReplacing
Event that is raised at the start of a call to Replace.
Top
See Also