CVB.Net 14.0
NodeMap Class Reference

Contains all nodes of a device or module. More...

Inherits ReadOnlyDictionaryBase< string, Node >, INativeHandle, and INodeMap.

Public Member Functions

void Dispose ()
 Disposes the native object wrapped by this object immediately. More...
 
void Close ()
 Alias of the Dispose() method. More...
 
override bool ContainsKey (string name)
 Gets whether a node with the name is contained in this node map. More...
 
bool TryGetValue< TNode > (string name, out TNode node)
 Tries to get the node with the given name . More...
 
override bool TryGetValue (string name, out Node value)
 Tries to get the node with the given name . More...
 
void PollNodes ()
 Polls all nodes of this node map that have a ValueNode.PollingTime.
 
void LoadSettings (string filename)
 Loads the node values from the gcs file given in filename and sets the node values accordingly. More...
 
void SaveSettings (string filename)
 Saves all nodes which have ValueNode.IsStreamable set to true. More...
 
void SaveSettings (string filename, params string[] nodeNames)
 Saves all nodes which are listed in nodeNames . More...
 
void SaveSettings (string filename, IEnumerable< Node > nodes)
 Saves all nodes . More...
 
string[] GetAvailableFiles ()
 Gets the currently available file identifiers, which can be downloaded or uploaded. More...
 
void DownloadFile (string filename, string fileSelectorEntryName)
 Downloads a file from the camera via the GenApi file download. More...
 
void UploadFile (string filename, string fileSelectorEntryName)
 Uploads a file to the camera via the GenApi file upload. More...
 
- Public Member Functions inherited from ReadOnlyDictionaryBase< string, Node >
virtual bool ContainsKey (TKey key)
 Determines whether the key is in this collection. More...
 
virtual bool TryGetValue (TKey key, out TValue value)
 Retrieves the value that is associated with the specific key . More...
 
bool TryGetValue< TNode > (string name, out TNode node)
 Tries to get the node with the given name . More...
 

Static Public Member Functions

static NodeMap FromHandle (IntPtr nativeHandle)
 Create a NodeMap from a native handle. More...
 
static NodeMap FromHandle (IntPtr nativeHandle, ShareObject doShare)
 Create a NodeMap from a native handle and potentially increment the unmanaged reference count on the native handle. More...
 

Protected Member Functions

override bool Contains (KeyValuePair< string, Node > item)
 Gets whether the given pair item is contained in this node map. More...
 
override IEnumerator< KeyValuePair< string, Node > > GetEnumerator ()
 Gets the enumerator for the KeyValuePair<TKey, TValue>s. More...
 
- Protected Member Functions inherited from ReadOnlyDictionaryBase< string, Node >
 ReadOnlyDictionaryBase (IDictionary< TKey, TValue > dictionary)
 Creates a new ReadOnlyDictionary wrapping the given dictionary . More...
 
virtual bool Contains (KeyValuePair< TKey, TValue > item)
 Determines whether the item is in this collection. More...
 
virtual void CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex)
 Copies the entire collection to a compatible one-dimensional array , starting at the specified arrayIndex . More...
 
virtual IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator ()
 Returns an enumerator that iterates through this collection. More...
 

Properties

bool IsDisposed [get]
 Tests whether the native handle has been disposed.
 
IntPtr Handle [get]
 Native CVB NODE handle. More...
 
override ICollection< NodeValues [get]
 Gets the value-collection containing all available nodes.
 
override Node this[string name] [get]
 Indexer to retrieve a node with the given name from this node map. More...
 
string ModuleName [get, set]
 Gets the GenTL module name this node map refers to.
 
string Description [get, set]
 Gets the descriptive text of this node map.
 
string VendorName [get]
 Gets the name of the vendor, who created the XML description. More...
 
string ModelName [get]
 Gets the name of the model, that the XML description is for. More...
 
string TransportLayerNamespace [get]
 Gets the transport layer type of the device.
 
string ToolTip [get]
 Gets the short descriptive text, if any is available.
 
GenApiVersion XmlFileVersion [get]
 Gets the XML version.
 
GenApiVersion XmlFileSchemaVersion [get]
 Gets the XML schema version.
 
- Properties inherited from ReadOnlyDictionaryBase< string, Node >
IDictionary< TKey, TValue > Dictionary [get]
 Gets the wrapped dictionary.
 
virtual TValue this[TKey key] [get]
 Gets the element that has the specified key . More...
 
int Count [get]
 Gets the number of items in the dictionary.
 
virtual ICollection< TKey > Keys [get]
 Gets a read-only collection of all keys in this dictionary.
 
virtual ICollection< TValue > Values [get]
 Gets a read-only collection of all values in this dictionary.
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 
- Properties inherited from INodeMap
new INode this[string name] [get]
 Indexer to retrieve a node with the given name from this node map. More...
 
string ModuleName [get]
 Gets the GenTL module name this node map refers to.
 
string VendorName [get]
 Gets the name of the vendor who created the XML description. More...
 
string ModelName [get]
 Gets the name of the model that the XML description is for. More...
 
string TransportLayerNamespace [get]
 Gets the transport layer type of the device.
 
GenApiVersion XmlFileVersion [get]
 Gets the XML version.
 
GenApiVersion XmlFileSchemaVersion [get]
 Gets the XML schema version.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method. More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Contains all nodes of a device or module.

Member Function Documentation

◆ Close()

void Close ( )

Alias of the Dispose() method.

Call this method to release the resources allocated by this node immediately. Remember that after calling Dispose, any subsequent access to references to this image will result in an ObjectDisposedException.

◆ Contains()

override bool Contains ( KeyValuePair< string, Node item)
protected

Gets whether the given pair item is contained in this node map.

Parameters
itemElement to be checked.
Returns
true if the key/value pair exists; false otherwise.

◆ ContainsKey()

override bool ContainsKey ( string  name)

Gets whether a node with the name is contained in this node map.

Parameters
nameName of the node (namespace prefix necessary).
Returns
true if the name exists in this dictionary.

◆ Dispose()

void Dispose ( )

Disposes the native object wrapped by this object immediately.

Call this method to release the resources allocated by this node immediately. Remember that after calling Dispose, any subsequent access to references to this image will result in an ObjectDisposedException.

◆ DownloadFile()

void DownloadFile ( string  filename,
string  fileSelectorEntryName 
)

Downloads a file from the camera via the GenApi file download.

See GetAvailableFiles for file ids which can be downloaded.

Parameters
filenameFull path to file to save data to.
fileSelectorEntryNameSymbolic name of the FileSelector EnumerationNode identifying the file to download.

◆ FromHandle() [1/2]

static NodeMap FromHandle ( IntPtr  nativeHandle)
static

Create a NodeMap from a native handle.

Note that this function is not intended for general use. Providing invalid values on the nativeHandle parameter will most likely lead to severe problems in your application.

Parameters
nativeHandlehandle to create the naode map from.
Returns
Newly created node map or null of no node map could be created.

◆ FromHandle() [2/2]

static NodeMap FromHandle ( IntPtr  nativeHandle,
ShareObject  doShare 
)
static

Create a NodeMap from a native handle and potentially increment the unmanaged reference count on the native handle.

Note that this function is not intended for general use. Providing invalid values on the nativeHandle parameter will most likely lead to severe problems in your application.

Parameters
nativeHandlehandle to create the image from.
doShareShareObject.Yes if nativeHandle is to be shared.
Returns
Newly created node map or null of no node map could be created.

◆ GetAvailableFiles()

string[] GetAvailableFiles ( )

Gets the currently available file identifiers, which can be downloaded or uploaded.

See DownloadFile(string, string) or UploadFile(string, string) for operations on the returned list.

Returns
Array containing the file identifiers; empty array for none.

◆ GetEnumerator()

override IEnumerator< KeyValuePair< string, Node > > GetEnumerator ( )
protectedvirtual

Gets the enumerator for the KeyValuePair<TKey, TValue>s.

Returns
Typed enumerator.

Reimplemented from ReadOnlyDictionaryBase< string, Node >.

◆ LoadSettings()

void LoadSettings ( string  filename)

Loads the node values from the gcs file given in filename and sets the node values accordingly.

Parameters
filenameComplete path to gcs file that contains the settings.

◆ SaveSettings() [1/3]

void SaveSettings ( string  filename)

Saves all nodes which have ValueNode.IsStreamable set to true.

Parameters
filenameComplete path to gcs file that contains the settings.

◆ SaveSettings() [2/3]

void SaveSettings ( string  filename,
IEnumerable< Node nodes 
)

Saves all nodes .

Parameters
filenameComplete path to gcs file that contains the settings.
nodesAll nodes to save.

◆ SaveSettings() [3/3]

void SaveSettings ( string  filename,
params string[]  nodeNames 
)

Saves all nodes which are listed in nodeNames .

Parameters
filenameComplete path to gcs file that contains the settings.
nodeNamesArray containing all names of the nodes to save.

◆ TryGetValue()

override bool TryGetValue ( string  name,
out Node  value 
)

Tries to get the node with the given name .

Parameters
nameName of the node (namespace prefix optional).
valueWill contain the Node object if present.
Returns
true if name is contained in this dictionary; false otherwise.

◆ TryGetValue< TNode >()

bool TryGetValue< TNode > ( string  name,
out TNode  node 
)

Tries to get the node with the given name .

Template Parameters
TNodeType of node to retrieve.
Parameters
nameName with or without the namespace prefix.
nodeNode instance; null if not found.
Returns
true if node with given name exists and is of type TNode.

Implements INodeMap.

Type Constraints
TNode :INode 

◆ UploadFile()

void UploadFile ( string  filename,
string  fileSelectorEntryName 
)

Uploads a file to the camera via the GenApi file upload.

See GetAvailableFiles for file ids which can be uploaded.

Parameters
filenameFull path to file to load data from.
fileSelectorEntryNameSymbolic name of the FileSelector EnumerationNode identifying the file to upload.

Property Documentation

◆ Handle

IntPtr Handle
get

Native CVB NODE handle.

It is normally not necessary to work with this handle in CVB.Net. Note that using this handle in connection with the legacy CVB managed wrappers may actually be disruptive to your application.

Implements INativeHandle.

◆ ModelName

string ModelName
get

Gets the name of the model, that the XML description is for.

Attention: often this name does not match the information of the GenTL port (discovery information).

Implements INodeMap.

◆ this[string name]

override Node this[string name]
get

Indexer to retrieve a node with the given name from this node map.

Parameters
nameName with or without the namespace prefix.
Returns
Node instance.
Exceptions
ArgumentNullExceptionThrown if name is null.
KeyNotFoundExceptionThrown if name does not exist in this collection.

Implements INodeMap.

◆ VendorName

string VendorName
get

Gets the name of the vendor, who created the XML description.

Attention: often this name does not match the information of the GenTL port (discovery information).

Implements INodeMap.

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.