OpcContext Members

Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcContext type exposes the following members.

Current

Gets or sets the OpcContext for the current thread.

C#

public static OpcContext Current { get; }


Property Value

OpcContext

The OpcContext that represents the context of the current thread.

Empty

Gets an empty OpcContext which can be used in cases there a session nor system specific context is not necessarily required.

C#

public static OpcContext Empty { get; }


Property Value

OpcContext

An instance of the OpcContext class without any contextual information.

Identity

Gets the OpcUserIdentity which belongs to the situation represented.

C#

public OpcUserIdentity Identity { get; }


Property Value

OpcUserIdentity

The OpcUserIdentity which belongs to the situation represented or a null reference (Nothing in Visual Basic) if there is no identity information available.

Namespaces

Gets a read-only collection of namespaces valid in the current OpcContext.

C#

public OpcReadOnlyNamespaceCollection Namespaces { get; }


Property Value

OpcReadOnlyNamespaceCollection

An instance of the OpcReadOnlyNamespaceCollection class with OpcNamespace items for each 'NamespaceUri' used to organize the nodes in an address space.

NodeIdFactory

Gets the OpcNodeIdFactory used to create new node identifiers using this context.

C#

public OpcNodeIdFactory NodeIdFactory { get; }


Property Value

OpcNodeIdFactory

The OpcNodeIdFactory used through this context or a null reference (Nothing in Visual Basic) if there is not node identifier factory associated with this context.

Owner

Gets the owner of the current OpcContext.

C#

public IOpcApplicationInstance Owner { get; }


Property Value

IOpcApplicationInstance

An instance implementing the IOpcApplicationInstance interface which has defined the current OpcContext.

PreferredLocales

Gets a collection of preferred locales (see CultureInfo.Name) to use to localize data and information.

C#

public virtual OpcLocaleCollection PreferredLocales { get; }


Property Value

OpcLocaleCollection

An instance of the OpcLocaleCollection class with CultureInfo.Names of the cultures to use to localize data and information in order of this OpcContext.

SessionId

Gets the session identifier which identifies the session within that the context has been created and is valid.

C#

public virtual OpcNodeId SessionId { get; }


Property Value

OpcNodeId

The OpcNodeId of the session.

Enter(IEnumerable<OpcNamespace>)

Enters a new OpcContext using the namespaces specified.

C#

public static OpcContext.Local Enter(IEnumerable<OpcNamespace> namespaces)


Parameters

namespaces IEnumerable<OpcNamespace>

A sequence of OpcNamespace instances known by the Namespaces of the new OpcContext to create.


Returns

Local

A new instance of the OpcContext class.

Enter(params OpcNamespace[])

Enters a new OpcContext using the namespaces specified.

C#

public static OpcContext.Local Enter(params OpcNamespace[] namespaces)


Parameters

namespaces OpcNamespace[]

An array of OpcNamespace instances known by the Namespaces of the new OpcContext to create.


Returns

Local

A new instance of the OpcContext class.

GetDataType(OpcEncoding)

Retrieves the OpcDataTypeInfo object which declares the type which is identified by the encoding specified.

C#

public OpcDataTypeInfo GetDataType(OpcEncoding encoding)


Parameters

encoding OpcEncoding

The OpcEncoding which identifies the OpcDataTypeInfo to retrieve.


Returns

OpcDataTypeInfo

The OpcDataTypeInfo object which is known under the encoding specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known OpcDataTypeInfo which is associated with the encoding specified.



Exceptions

ArgumentNullException

The encoding is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetDataType(OpcName)

Retrieves the OpcDataTypeInfo object which is known under the name specified.

C#

public OpcDataTypeInfo GetDataType(OpcName name)


Parameters

name OpcName

The OpcName of the OpcDataTypeInfo object to retrieve.


Returns

OpcDataTypeInfo

The OpcDataTypeInfo object its Name is equals to the name specified; otherwise a null reference (Nothing in Visual Basic).



Exceptions

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetDataType(OpcNodeId)

Retrieves the OpcDataTypeInfo object which declares the type which is identified by the typeId specified.

C#

public OpcDataTypeInfo GetDataType(OpcNodeId typeId)


Parameters

typeId OpcNodeId

The OpcNodeId which identifies the OpcDataTypeInfo to retrieve.


Returns

OpcDataTypeInfo

The OpcDataTypeInfo object which is known under the typeId specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known OpcDataTypeInfo object which is associated with the typeId specified.



Exceptions

ArgumentNullException

The typeId is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetDataType(string)

Retrieves the OpcDataTypeInfo object which is known under the name specified.

C#

public OpcDataTypeInfo GetDataType(string name)


Parameters

name String

The String to use to identify the OpcDataTypeInfo object to retrieve.


Returns

OpcDataTypeInfo

The OpcDataTypeInfo object its Name is equals (regarding its Value) to the name specified; otherwise a null reference (Nothing in Visual Basic).



Exceptions

ArgumentException

The name is equals Empty.

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetDataType(Type)

Retrieves the OpcDataTypeInfo object which declares the type implemented by the underlyingType specified.

C#

public OpcDataTypeInfo GetDataType(Type underlyingType)


Parameters

underlyingType Type

The Type which implements the OpcDataTypeInfo to retrieve.


Returns

OpcDataTypeInfo

The OpcDataTypeInfo object which declares the underlyingType specified or a null reference (Nothing in Visual Basic) if there isn't a OpcDataTypeInfo object associated with the underlyingType specified.



Exceptions

ArgumentNullException

The underlyingType is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetDataType(XmlQualifiedName)

Retrieves the OpcDataTypeInfo object which is known under the xmlName specified.

C#

public OpcDataTypeInfo GetDataType(XmlQualifiedName xmlName)


Parameters

xmlName XmlQualifiedName

The XmlQualifiedName of the OpcDataTypeInfo object to retrieve.


Returns

OpcDataTypeInfo

The OpcDataTypeInfo object its XmlName is equals to the xmlName specified; otherwise a null reference (Nothing in Visual Basic).



Exceptions

ArgumentNullException

The xmlName is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetNodeType(OpcName)

Retrieves the OpcNodeTypeInfo object which is known under the name specified.

C#

public OpcNodeTypeInfo GetNodeType(OpcName name)


Parameters

name OpcName

The OpcName of the OpcNodeTypeInfo object to retrieve.


Returns

OpcNodeTypeInfo

The OpcNodeTypeInfo object its Name is equals to the name specified; otherwise a null reference (Nothing in Visual Basic).



Exceptions

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetNodeType(OpcNodeId)

Retrieves the OpcNodeTypeInfo object which declares the type which is identified by the typeId specified.

C#

public OpcNodeTypeInfo GetNodeType(OpcNodeId typeId)


Parameters

typeId OpcNodeId

The OpcNodeId which identifies the OpcNodeTypeInfo to retrieve.


Returns

OpcNodeTypeInfo

The OpcNodeTypeInfo object which is known under the typeId specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known OpcNodeTypeInfo object which is associated with the typeId specified.



Exceptions

ArgumentNullException

The typeId is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetNodeType(string)

Retrieves the OpcNodeTypeInfo object which is known under the name specified.

C#

public OpcNodeTypeInfo GetNodeType(string name)


Parameters

name String

The String to use to identify the OpcNodeTypeInfo object to retrieve.


Returns

OpcNodeTypeInfo

The OpcNodeTypeInfo object its Name is equals (regarding its Value) to the name specified; otherwise a null reference (Nothing in Visual Basic).



Exceptions

ArgumentException

The name is equals Empty.

ArgumentNullException

The name is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

GetNodeType(Type)

Retrieves the OpcNodeTypeInfo object which declares the type implemented by the underlyingType specified.

C#

public OpcNodeTypeInfo GetNodeType(Type underlyingType)


Parameters

underlyingType Type

The Type which implements the OpcNodeTypeInfo to retrieve.


Returns

OpcNodeTypeInfo

The OpcNodeTypeInfo object which declares the underlyingType specified or a null reference (Nothing in Visual Basic) if there isn't a OpcNodeTypeInfo object associated with the underlyingType specified.



Exceptions

ArgumentNullException

The underlyingType is a null reference (Nothing in Visual Basic).

ObjectDisposedException

The object has been disposed of.

OfNode(OpcNode)

C#

public OpcNodeContext OfNode(OpcNode node)


Parameters

node OpcNode



Returns

OpcNodeContext



Exceptions

ArgumentNullException