Class PropertyMap

Represents the property interface of a component, usually a video capture device.

Inheritance

PropertyMap

Implements

Namespace: ic4
Assembly: ic4dotnet.dll
Syntax
public class PropertyMap : HandleObject, IDisposable
Remarks

A property map offers quick access to known properties as well as functions to enumerate all features through the category tree.

There is a plethora of overloaded functions to access properties with a known name and type. For example, to find a known integer property, use:

To find a property with a known name, but unknown type, use one of the untyped functions:

Property values for known properties can also be set directly, for example by calling:

To get a flat list of all properties in the property map's category tree, enumerate All.

The current values of all properties in a property map can be saved to a file or a memory buffer using Serialize() or one of its overloads. To restore the settings at a later time, call DeSerialize(byte[]).

An image buffer containing chunk data can be connected to a property map using ConnectChunkData(ImageBuffer). Doing so lets the property map uses the image buffer as the data source for chunk property read operations.

Properties

All

Enumerates all properties reachable from the property map's Root category.

Declaration

public IEnumerable<Property> All { get; }
Property Value
Type Description
IEnumerable<Property>

An enumeration of Property objects for all properties reachable from this property map's Root category.

Exceptions

Type Condition
IC4Exception

Check ErrorCode and ToString() for details.

this[string]

Returns the property with a given name.

Declaration

public Property this[string propName] { get; }

Parameters

Type Name Description
string propName

The name of the property to return

Property Value
Type Description
Property

The property whose name is equal to propName

Remarks

This is a shortcut for calling Find(string)

If there is no property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(string, out Property).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdBoolean]

Returns the boolean property with a specified identifier.

Declaration

public PropBoolean this[PropIdBoolean booleanId] { get; }

Parameters

Type Name Description
PropIdBoolean booleanId

The identifier of the boolean property to find

Property Value
Type Description
PropBoolean

The boolean property matching the identifier booleanId

Remarks

This is a shortcut for calling Find(PropIdBoolean)

If there is no boolean property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdBoolean, out PropBoolean).

Exceptions

Type Condition
ArgumentNullException

booleanId is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdCommand]

Returns the command property with a specified identifier.

Declaration

public PropCommand this[PropIdCommand commandId] { get; }

Parameters

Type Name Description
PropIdCommand commandId

The identifier of the command property to find

Property Value
Type Description
PropCommand

The command property matching the identifier commandId

Remarks

This is a shortcut for calling Find(PropIdCommand)

If there is no command property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdCommand, out PropCommand).

Exceptions

Type Condition
ArgumentNullException

commandId is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdEnumeration]

Returns the enumeration property with a specified identifier.

Declaration

public PropEnumeration this[PropIdEnumeration enumerationId] { get; }

Parameters

Type Name Description
PropIdEnumeration enumerationId

The identifier of the enumeration property to find

Property Value
Type Description
PropEnumeration

The enumeration property matching the identifier enumerationId

Remarks

This is a shortcut for calling Find(PropIdEnumeration)

If there is no enumeration property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdEnumeration, out PropEnumeration).

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdFloat]

Returns the float property with a specified identifier.

Declaration

public PropFloat this[PropIdFloat floatId] { get; }

Parameters

Type Name Description
PropIdFloat floatId

The identifier of the float property to find

Property Value
Type Description
PropFloat

The float property matching the identifier floatId

Remarks

This is a shortcut for calling Find(PropIdFloat)

If there is no float property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdFloat, out PropFloat).

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdInteger]

Returns the integer property with a specified identifier.

Declaration

public PropInteger this[PropIdInteger integerId] { get; }

Parameters

Type Name Description
PropIdInteger integerId

The identifier of the integer property to find

Property Value
Type Description
PropInteger

The integer property matching the identifier integerId

Remarks

This is a shortcut for calling Find(PropIdInteger)

If there is no integer property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdInteger, out PropInteger).

Exceptions

Type Condition
ArgumentNullException

integerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdRegister]

Returns the register property with a specified identifier.

Declaration

public PropRegister this[PropIdRegister registerId] { get; }

Parameters

Type Name Description
PropIdRegister registerId

The identifier of the register property to find

Property Value
Type Description
PropRegister

The register property matching the identifier registerId

Remarks

This is a shortcut for calling Find(PropIdRegister)

If there is no register property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdRegister, out PropRegister).

Exceptions

Type Condition
ArgumentNullException

registerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

this[PropIdString]

Returns the string property with a specified identifier.

Declaration

public PropString this[PropIdString stringId] { get; }

Parameters

Type Name Description
PropIdString stringId

The identifier of the string property to find

Property Value
Type Description
PropString

The string property matching the identifier stringId

Remarks

This is a shortcut for calling Find(PropIdString)

If there is no string property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdString, out PropString).

Exceptions

Type Condition
ArgumentNullException

stringId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Methods

ConnectChunkData(ImageBuffer)

Enables the use of the chunk data in the passed ImageBuffer as a backend for chunk properties in the property map.

Declaration

public void ConnectChunkData(ImageBuffer buffer)

Parameters

Type Name Description
ImageBuffer buffer

An image buffer with chunk data. This parameter may be null to disconnect the previously connected buffer.

Remarks

The property map takes a reference to the passed image buffer, extending its lifetime and preventing automatic reuse. The reference is released when a new image buffer is connected to the property map, or null is passed in the buffer argument.

DeSerialize(byte[])

Restores the state of the properties in this property map from a memory buffer containing data that was previously written by Serialize().

Declaration

public void DeSerialize(byte[] data)

Parameters

Type Name Description
byte[] data

A byte array containing serialized property data

Exceptions

Type Condition
ArgumentNullException

data is null.

IC4Exception

Check ErrorCode and ToString() for details.

DeSerialize(Stream)

Restores the state of the properties in this property map from a stream that was previously written by Serialize(Stream).

Declaration

public void DeSerialize(Stream strm)

Parameters

Type Name Description
Stream strm

A stream containing serialized property data

Exceptions

Type Condition
ArgumentNullException

strm is null.

IC4Exception

Check ErrorCode and ToString() for details.

DeSerialize(string)

Restores the state of the properties in this property map from a file that was previously written by Serialize(string).

Declaration

public void DeSerialize(string fileName)

Parameters

Type Name Description
string fileName

Path to a file containing serialized property data

Exceptions

Type Condition
ArgumentNullException

fileName is null

IC4Exception

Check ErrorCode and ToString() for details.

ExecuteCommand(string)

Executes a command with a known name.

Declaration

public void ExecuteCommand(string commandName)

Parameters

Type Name Description
string commandName

Name of a command in this property map

Exceptions

Type Condition
ArgumentNullException

commandName is null.

IC4Exception

Check ErrorCode and ToString() for details.

ExecuteCommand(PropIdCommand)

Executes a command with a specified identifier.

Declaration

public void ExecuteCommand(PropIdCommand commandId)

Parameters

Type Name Description
PropIdCommand commandId

Identifier of a command in this property map

Exceptions

Type Condition
ArgumentNullException

commandId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(string)

Returns the property with a given name.

Declaration

public Property Find(string propName)

Parameters

Type Name Description
string propName

The name of the property to find

Returns

Type Description
Property

The property whose name is equal to propName

Remarks

If there is no property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(string, out Property).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdBoolean)

Returns the boolean property with a specified identifier.

Declaration

public PropBoolean Find(PropIdBoolean booleanId)

Parameters

Type Name Description
PropIdBoolean booleanId

The identifier of the boolean property to find

Returns

Type Description
PropBoolean

The boolean property matching the identifier booleanId

Remarks

If there is no boolean property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdBoolean, out PropBoolean).

Exceptions

Type Condition
ArgumentNullException

booleanId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdCommand)

Returns the command property with a specified identifier.

Declaration

public PropCommand Find(PropIdCommand commandId)

Parameters

Type Name Description
PropIdCommand commandId

The identifier of the command property to find

Returns

Type Description
PropCommand

The command property matching the identifier commandId

Remarks

If there is no command property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdCommand, out PropCommand).

Exceptions

Type Condition
ArgumentNullException

commandId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdEnumeration)

Returns the enumeration property with a specified identifier.

Declaration

public PropEnumeration Find(PropIdEnumeration enumerationId)

Parameters

Type Name Description
PropIdEnumeration enumerationId

The identifier of the enumeration property to find

Returns

Type Description
PropEnumeration

The enumeration property matching the identifier enumerationId

Remarks

If there is no enumeration property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdEnumeration, out PropEnumeration).

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdFloat)

Returns the float property with a specified identifier.

Declaration

public PropFloat Find(PropIdFloat floatId)

Parameters

Type Name Description
PropIdFloat floatId

The identifier of the float property to find

Returns

Type Description
PropFloat

The float property matching the identifier floatId

Remarks

If there is no float property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdFloat, out PropFloat).

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdInteger)

Returns the integer property with a specified identifier.

Declaration

public PropInteger Find(PropIdInteger integerId)

Parameters

Type Name Description
PropIdInteger integerId

The identifier of the integer property to find

Returns

Type Description
PropInteger

The integer property matching the identifier integerId

Remarks

If there is no integer property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdInteger, out PropInteger).

Exceptions

Type Condition
ArgumentNullException

integerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdRegister)

Returns the register property with a specified identifier.

Declaration

public PropRegister Find(PropIdRegister registerId)

Parameters

Type Name Description
PropIdRegister registerId

The identifier of the register property to find

Returns

Type Description
PropRegister

The register property matching the identifier registerId

Remarks

If there is no register property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdRegister, out PropRegister).

Exceptions

Type Condition
ArgumentNullException

registerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Find(PropIdString)

Returns the string property with a specified identifier.

Declaration

public PropString Find(PropIdString stringId)

Parameters

Type Name Description
PropIdString stringId

The identifier of the string property to find

Returns

Type Description
PropString

The string property matching the identifier stringId

Remarks

If there is no string property matching the identifier in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFind(PropIdString, out PropString).

Exceptions

Type Condition
ArgumentNullException

stringId is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindBoolean(string)

Returns the boolean property with a given name.

Declaration

public PropBoolean FindBoolean(string propName)

Parameters

Type Name Description
string propName

The name of the boolean property to find

Returns

Type Description
PropBoolean

The boolean property whose name is equal to propName

Remarks

If there is no boolean property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindBoolean(string, out PropBoolean).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindCategory(string)

Returns the category property with a given name.

Declaration

public PropCategory FindCategory(string propName)

Parameters

Type Name Description
string propName

The name of the category property to find

Returns

Type Description
PropCategory

The category property whose name is equal to propName

Remarks

If there is no category property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindCategory(string, out PropCategory).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindCommand(string)

Returns the command property with a given name.

Declaration

public PropCommand FindCommand(string propName)

Parameters

Type Name Description
string propName

The name of the command property to find

Returns

Type Description
PropCommand

The command property whose name is equal to propName

Remarks

If there is no command property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindCommand(string, out PropCommand).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindEnumeration(string)

Returns the enumeration property with a given name.

Declaration

public PropEnumeration FindEnumeration(string propName)

Parameters

Type Name Description
string propName

The name of the enumeration property to find

Returns

Type Description
PropEnumeration

The enumeration property whose name is equal to propName

Remarks

If there is no enumeration property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindEnumeration(string, out PropEnumeration).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindFloat(string)

Returns the float property with a given name.

Declaration

public PropFloat FindFloat(string propName)

Parameters

Type Name Description
string propName

The name of the float property to find

Returns

Type Description
PropFloat

The float property whose name is equal to propName

Remarks

If there is no float property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindFloat(string, out PropFloat).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindInteger(string)

Returns the integer property with a given name.

Declaration

public PropInteger FindInteger(string propName)

Parameters

Type Name Description
string propName

The name of the integer property to find

Returns

Type Description
PropInteger

The integer property whose name is equal to propName

Remarks

If there is no integer property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindInteger(string, out PropInteger).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindRegister(string)

Returns the register property with a given name.

Declaration

public PropRegister FindRegister(string propName)

Parameters

Type Name Description
string propName

The name of the register property to find

Returns

Type Description
PropRegister

The register property whose name is equal to propName

Remarks

If there is no register property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindRegister(string, out PropRegister).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

FindString(string)

Returns the string property with a given name.

Declaration

public PropString FindString(string propName)

Parameters

Type Name Description
string propName

The name of the string property to find

Returns

Type Description
PropString

The string property whose name is equal to propName

Remarks

If there is no string property with the the given name in this property map, an IC4Exception is thrown.

To avoid an exception being thrown in case the property is not found, use TryFindString(string, out PropString).

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueBool(string)

Get the value of a property with a known name interpreted as a bool.

Declaration

public bool GetValueBool(string propName)

Parameters

Type Name Description
string propName

Name of a property in this property map

Returns

Type Description
bool

The value of the property interpreted as a bool.

Remarks

The behavior depends on the type of the property:

  • For boolean properties, the value is returned directly.
  • For enumeration properties, a value is returned if the name of the currently selected entry unambiguously suggests to represent true or false.
  • For all other property types, the call results in an error. (IC4Exception with ErrorCode set to GenICamTypeMismatch.)

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueBool(PropIdBoolean)

Gets the value of a boolean property with a specific identifier.

Declaration

public bool GetValueBool(PropIdBoolean booleanId)

Parameters

Type Name Description
PropIdBoolean booleanId

Identifier of a boolean property in this property map

Returns

Type Description
bool

The value of the boolean property

Exceptions

Type Condition
ArgumentNullException

booleanId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueBool(PropIdEnumeration)

Gets a boolean representation of the value of an enumeration property with a specific identifier.

Declaration

public bool GetValueBool(PropIdEnumeration enumerationId)

Parameters

Type Name Description
PropIdEnumeration enumerationId

Identifier of an enumeration property in this property map

Returns

Type Description
bool

The value of the enumeration property interpreted as a boolean value.

Remarks

A value is returned if the name of the currently selected entry unambiguously suggests to represent true or false.

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueDouble(string)

Get the value of a property with a known name interpreted as a double.

Declaration

public double GetValueDouble(string propName)

Parameters

Type Name Description
string propName

Name of a property in this property map

Returns

Type Description
double

The value of the property interpreted as a double.

Remarks

The behavior depends on the type of the property:

  • For float properties, the value is returned directly.
  • For integer properties, the value is converted to double.
  • For all other property types, the call results in an error. (IC4Exception with ErrorCode set to GenICamTypeMismatch.)

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueDouble(PropIdFloat)

Gets the value of a float property with a specific identifier.

Declaration

public double GetValueDouble(PropIdFloat floatId)

Parameters

Type Name Description
PropIdFloat floatId

Identifier of a float property in this property map

Returns

Type Description
double

The value of the float property

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueDouble(PropIdInteger)

Gets the value of an integer property with a specific identifier, converted to double.

Declaration

public double GetValueDouble(PropIdInteger integerId)

Parameters

Type Name Description
PropIdInteger integerId

Identifier of an integer property in this property map

Returns

Type Description
double

The value of the integer property converted to double

Exceptions

Type Condition
ArgumentNullException

integerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueLong(string)

Get the value of a property with a known name interpreted as an integer.

Declaration

public long GetValueLong(string propName)

Parameters

Type Name Description
string propName

Name of a property in this property map

Returns

Type Description
long

The value of the property interpreted as an integer.

Remarks

The behavior depends on the type of the property:

  • For integer properties, the value is returned directly.
  • For boolean properties, the value returned is 1 or 0.
  • For all other property types, the call results in an error. (IC4Exception with ErrorCode set to GenICamTypeMismatch.)

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueLong(PropIdBoolean)

Gets an integer-representation of a boolean property with a specific identifier.

Declaration

public long GetValueLong(PropIdBoolean booleanId)

Parameters

Type Name Description
PropIdBoolean booleanId

Identifier of an integer property in this property map

Returns

Type Description
long

1 if the property's value is true, otherwise false.

Exceptions

Type Condition
ArgumentNullException

booleanId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueLong(PropIdEnumeration)

Gets the currently selected pixel format if the passed enumeration property it PixelFormat.

Declaration

public PixelFormat GetValueLong(PropIdEnumeration enumerationId)

Parameters

Type Name Description
PropIdEnumeration enumerationId

Identifier of a enumeration property in this property map

Returns

Type Description
PixelFormat

The integer value of the currently selected entry converted into a PixelFormat value.

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueLong(PropIdInteger)

Gets the value of an integer property with a specific identifier.

Declaration

public long GetValueLong(PropIdInteger integerId)

Parameters

Type Name Description
PropIdInteger integerId

Identifier of an integer property in this property map

Returns

Type Description
long

The value of the integer property

Exceptions

Type Condition
ArgumentNullException

integerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueString(string)

Get the value of a property with a known name interpreted as a string.

Declaration

public string GetValueString(string propName)

Parameters

Type Name Description
string propName

Name of a property in this property map

Returns

Type Description
string

The value of the property interpreted as a string.

Remarks

The behavior depends on the type of the property:

  • For integer properties, the value is converted to a string.
  • For float properties, the value is converted to a string.
  • For boolean properties, the returned value is "true" or "false".
  • For enumeration properties, the name of the currently selected entry is returned.
  • For string properties, the value is returned directly.
  • For all other property types, the call results in an error. (IC4Exception with ErrorCode set to GenICamTypeMismatch.)

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueString(PropIdBoolean)

Returns a string representation for the value of the boolean property with a specific identifier.

Declaration

public string GetValueString(PropIdBoolean booleanId)

Parameters

Type Name Description
PropIdBoolean booleanId

Identifier of a boolean property in this property map

Returns

Type Description
string

A string representation of the value of the boolean property

Exceptions

Type Condition
ArgumentNullException

booleanId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueString(PropIdEnumeration)

Returns a string representation for the value of the enumeration property with a specific identifier.

Declaration

public string GetValueString(PropIdEnumeration enumerationId)

Parameters

Type Name Description
PropIdEnumeration enumerationId

Identifier of an enumeration property in this property map

Returns

Type Description
string

A string representation of the value of the enumeration property

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueString(PropIdFloat)

Returns a string representation for the value of the float property with a specific identifier.

Declaration

public string GetValueString(PropIdFloat floatId)

Parameters

Type Name Description
PropIdFloat floatId

Identifier of a float property in this property map

Returns

Type Description
string

A string representation of the value of the float property

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueString(PropIdInteger)

Returns a string representation for the value of the integer property with a specific identifier.

Declaration

public string GetValueString(PropIdInteger integerId)

Parameters

Type Name Description
PropIdInteger integerId

Identifier of an integer property in this property map

Returns

Type Description
string

A string representation of the value of the integer property

Exceptions

Type Condition
ArgumentNullException

integerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

GetValueString(PropIdString)

Returns a string representation for the value of the string property with a specific identifier.

Declaration

public string GetValueString(PropIdString stringId)

Parameters

Type Name Description
PropIdString stringId

Identifier of a string property in this property map

Returns

Type Description
string

A string representation of the value of the string property

Exceptions

Type Condition
ArgumentNullException

stringId is null.

IC4Exception

Check ErrorCode and ToString() for details.

Serialize()

Saves the state of the properties in this property map in a memory buffer.

Declaration

public byte[] Serialize()

Returns

Type Description
byte[]

A byte array containing the serialized property state

Remarks

To restore the state of the properties at a later time, use DeSerialize(byte[]).

Exceptions

Type Condition
IC4Exception

Check ErrorCode and ToString() for details.

Serialize(Stream)

Saves the state of the properties in this property map in a Stream.

Declaration

public void Serialize(Stream strm)

Parameters

Type Name Description
Stream strm

Stream to write the property state to

Remarks

To restore the state of the properties at a later time, use DeSerialize(Stream).

Exceptions

Type Condition
ArgumentNullException

strm is null.

IC4Exception

Check ErrorCode and ToString() for details.

Serialize(string)

Saves the state of the properties in this property map in a file.

Declaration

public void Serialize(string fileName)

Parameters

Type Name Description
string fileName

Path to the file to write the property state to

Remarks

To restore the state of the properties at a later time, use DeSerialize(string).

Exceptions

Type Condition
ArgumentNullException

fileName is null

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(string, bool)

Set the value of a property with a known name to the passed bool value.

Declaration

public void SetValue(string propName, bool value)

Parameters

Type Name Description
string propName

Name of a property in this property map

bool value

New value to be set

Remarks

The behavior depends on the type of the property:

  • For boolean properties, the value is set directly.
  • For enumeration properties, it selects the entry with a name that unambiguously suggests to represent true or false, if available.
  • For command properties, the command is executed if value is true.
  • For all other property types, the call results in an error.

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(string, double)

Set the value of a property with a known name to the passed double value.

Declaration

public void SetValue(string propName, double value)

Parameters

Type Name Description
string propName

Name of a property in this property map

double value

New value to be set

Remarks

The behavior depends on the type of the property:

  • For integer properties, the value is rounded to the nearest integer.
  • For float properties, the value is set directly.
  • For all other property types, the call results in an error.

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(string, long)

Set the value of a property with a known name to the passed integer value.

Declaration

public void SetValue(string propName, long value)

Parameters

Type Name Description
string propName

Name of a property in this property map

long value

New value to be set

Remarks

The behavior depends on the type of the property:

  • For integer properties, the value is set directly.
  • For float properties, the value is set directly.
  • For boolean properties, if the value is 1 or 0, it is set to true or false respectively. Other values result in an error.
  • For enumeration properties, the value is set directly.
  • For command properties, the command is executed if the value is 1.
  • For all other property types, the call results in an error.

Exceptions

Type Condition
ArgumentNullException

propName is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(string, string)

Set the value of a property with a known name to the passed string value.

Declaration

public void SetValue(string propName, string value)

Parameters

Type Name Description
string propName

Name of a property in this property map

string value

New value to be set

Remarks

The behavior depends on the type of property:

  • For integer properties, the string is parsed, and the found integer value is set.
  • For float properties, the string is parsed, and the found floating-point value is set.
  • For boolean properties, a value is set if the string can be unambiguously identified to represent true or false.
  • For enumeration properties, the entry with a naming matching the value is set.
  • For string properties, the value is set directly.
  • For command properties, the command is executed if value is "1", "true" or "execute".
  • For all other property types, the call results in an error.

Exceptions

Type Condition
ArgumentNullException

propName is null or value is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdBoolean, bool)

Set the value of a boolean property with specified identifier to the passed bool value.

Declaration

public void SetValue(PropIdBoolean boolId, bool value)

Parameters

Type Name Description
PropIdBoolean boolId

Identifier of a boolean property in this property map

bool value

New value to be set

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdBoolean, string)

Set the value of a boolean property with a specified identifier to the passed string value.

Declaration

public void SetValue(PropIdBoolean boolId, string value)

Parameters

Type Name Description
PropIdBoolean boolId

Identifier of a boolean property in this property map

string value

New value to be set

Remarks

The value is set if the string can be unambiguously identified to represent @c true or @c false.

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdEnumeration, bool)

Selects an entry in the enumeration property with specified identifier matching the passed bool value.

Declaration

public void SetValue(PropIdEnumeration enumerationId, bool value)

Parameters

Type Name Description
PropIdEnumeration enumerationId

Identifier of an enumeration property in this property map, usually PixelFormat

bool value

The new value to be set

Remarks

An entry is only selected if there is an entry with a name that unambiguously suggests to represent @c true or @c false.

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdEnumeration, string)

Selects the current entry of an enumeration property by its name.

Declaration

public void SetValue(PropIdEnumeration enumerationId, string entryName)

Parameters

Type Name Description
PropIdEnumeration enumerationId

Identifier of an enumeration property in this property map

string entryName

Name of the entry to be selected

Exceptions

Type Condition
ArgumentNullException

enumerationId is null or entryName is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdEnumeration, PixelFormat)

Selects the current entry of an enumeration property to a PixelFormat value.

Declaration

public void SetValue(PropIdEnumeration enumerationId, PixelFormat pixelFormat)

Parameters

Type Name Description
PropIdEnumeration enumerationId

Identifier of an enumeration property in this property map, usually PixelFormat

PixelFormat pixelFormat

The pixel format to be set

Remarks

This overload exists to avoid a cast when configuring the pixelformat.

Exceptions

Type Condition
ArgumentNullException

enumerationId is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdFloat, double)

Set the value of a float property with specified identifier to the passed double value.

Declaration

public void SetValue(PropIdFloat floatId, double value)

Parameters

Type Name Description
PropIdFloat floatId

Identifier of a float property in this property map

double value

New value to be set

Exceptions

Type Condition
ArgumentNullException

floatId is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdInteger, long)

Set the value of an integer property with specified identifier to the passed integer value.

Declaration

public void SetValue(PropIdInteger integerId, long value)

Parameters

Type Name Description
PropIdInteger integerId

Identifier of an integer property in this property map

long value

New value to be set

Exceptions

Type Condition
ArgumentNullException

integerId is null.

IC4Exception

Check ErrorCode and ToString() for details.

SetValue(PropIdString, string)

Set the value of a string property with a specified identifier to the passed string value.

Declaration

public void SetValue(PropIdString stringId, string value)

Parameters

Type Name Description
PropIdString stringId

Identifier of a string property in this property map

string value

New value to be set

Exceptions

Type Condition
ArgumentNullException

stringId is null or value is null.

IC4Exception

Check ErrorCode and ToString() for details.

TryFind(string, out Property)

Tries to find a property with a given name in this property map.

Declaration

public bool TryFind(string propName, out Property prop)

Parameters

Type Name Description
string propName

Name of the property

Property prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(string) to avoid an exception being thrown if an error occurs.

TryFind(PropIdBoolean, out PropBoolean)

Tries to find a boolean property with a specifier.

Declaration

public bool TryFind(PropIdBoolean booleanId, out PropBoolean prop)

Parameters

Type Name Description
PropIdBoolean booleanId

The identifier of the boolean property to find

PropBoolean prop

Output parameter receiving the boolean property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdBoolean) to avoid an exception being thrown if an error occurs.

TryFind(PropIdCommand, out PropCommand)

Tries to find a command property with a specifier.

Declaration

public bool TryFind(PropIdCommand commandId, out PropCommand prop)

Parameters

Type Name Description
PropIdCommand commandId

The identifier of the command property to find

PropCommand prop

Output parameter receiving the command property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdCommand) to avoid an exception being thrown if an error occurs.

TryFind(PropIdEnumeration, out PropEnumeration)

Tries to find an enumeration property with a specifier.

Declaration

public bool TryFind(PropIdEnumeration enumerationId, out PropEnumeration prop)

Parameters

Type Name Description
PropIdEnumeration enumerationId

The identifier of the enumeration property to find

PropEnumeration prop

Output parameter receiving the enumeration property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdEnumeration) to avoid an exception being thrown if an error occurs.

TryFind(PropIdFloat, out PropFloat)

Tries to find a float property with a specifier.

Declaration

public bool TryFind(PropIdFloat floatId, out PropFloat prop)

Parameters

Type Name Description
PropIdFloat floatId

The identifier of the float property to find

PropFloat prop

Output parameter receiving the float property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdFloat) to avoid an exception being thrown if an error occurs.

TryFind(PropIdInteger, out PropInteger)

Tries to find an integer property with a specifier.

Declaration

public bool TryFind(PropIdInteger integerId, out PropInteger prop)

Parameters

Type Name Description
PropIdInteger integerId

The identifier of the integer property to find

PropInteger prop

Output parameter receiving the integer property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdInteger) to avoid an exception being thrown if an error occurs.

TryFind(PropIdRegister, out PropRegister)

Tries to find a register property with a specifier.

Declaration

public bool TryFind(PropIdRegister registerId, out PropRegister prop)

Parameters

Type Name Description
PropIdRegister registerId

The identifier of the register property to find

PropRegister prop

Output parameter receiving the register property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdRegister) to avoid an exception being thrown if an error occurs.

TryFind(PropIdString, out PropString)

Tries to find a string property with a specifier.

Declaration

public bool TryFind(PropIdString stringId, out PropString prop)

Parameters

Type Name Description
PropIdString stringId

The identifier of the string property to find

PropString prop

Output parameter receiving the string property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of Find(PropIdString) to avoid an exception being thrown if an error occurs.

TryFindBoolean(string, out PropBoolean)

Tries to find a boolean property with a given name in this property map.

Declaration

public bool TryFindBoolean(string propName, out PropBoolean prop)

Parameters

Type Name Description
string propName

Name of the boolean property

PropBoolean prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindBoolean(string) to avoid an exception being thrown if an error occurs.

TryFindCategory(string, out PropCategory)

Tries to find a category property with a given name in this property map.

Declaration

public bool TryFindCategory(string propName, out PropCategory prop)

Parameters

Type Name Description
string propName

Name of the category property

PropCategory prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindCategory(string) to avoid an exception being thrown if an error occurs.

TryFindCommand(string, out PropCommand)

Tries to find a command property with a given name in this property map.

Declaration

public bool TryFindCommand(string propName, out PropCommand prop)

Parameters

Type Name Description
string propName

Name of the command property

PropCommand prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindCommand(string) to avoid an exception being thrown if an error occurs.

TryFindEnumeration(string, out PropEnumeration)

Tries to find an enumeration property with a given name in this property map.

Declaration

public bool TryFindEnumeration(string propName, out PropEnumeration prop)

Parameters

Type Name Description
string propName

Name of the enumeration property

PropEnumeration prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindEnumeration(string) to avoid an exception being thrown if an error occurs.

TryFindFloat(string, out PropFloat)

Tries to find a float property with a given name in this property map.

Declaration

public bool TryFindFloat(string propName, out PropFloat prop)

Parameters

Type Name Description
string propName

Name of the float property

PropFloat prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindFloat(string) to avoid an exception being thrown if an error occurs.

TryFindInteger(string, out PropInteger)

Tries to find an integer property with a given name in this property map.

Declaration

public bool TryFindInteger(string propName, out PropInteger prop)

Parameters

Type Name Description
string propName

Name of the integer property

PropInteger prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindInteger(string) to avoid an exception being thrown if an error occurs.

TryFindRegister(string, out PropRegister)

Tries to find a register property with a given name in this property map.

Declaration

public bool TryFindRegister(string propName, out PropRegister prop)

Parameters

Type Name Description
string propName

Name of the register property

PropRegister prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindRegister(string) to avoid an exception being thrown if an error occurs.

TryFindString(string, out PropString)

Tries to find a string property with a given name in this property map.

Declaration

public bool TryFindString(string propName, out PropString prop)

Parameters

Type Name Description
string propName

Name of the string property

PropString prop

Output parameter receiving the property object on success

Returns

Type Description
bool

true, if the property was found, otherwise false

Remarks

Use this function instead of FindString(string) to avoid an exception being thrown if an error occurs.

Implements