Skip to content

Reference

OpcContext Members

Provides information and services about the system which belong to the current situation (process, thread, session, etc.).

Reference

OpcContext Members ​

Type
OpcContext
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Properties ​

Current ​

static · since v2.50

Gets or sets the OpcContext for the current thread.

csharp
public static OpcContext Current { get; }
vbnet
Public Shared ReadOnly Property Current As OpcContext

Property value

OpcContext

The OpcContext that represents the context of the current thread.

Empty ​

static · since v2.9

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

csharp
public static OpcContext Empty { get; }
vbnet
Public Shared ReadOnly Property Empty As OpcContext

Property value

OpcContext

An instance of the OpcContext class without any contextual information.

Identity ​

Gets the OpcUserIdentity which belongs to the situation represented.

csharp
public OpcUserIdentity Identity { get; }
vbnet
Public ReadOnly Property Identity As OpcUserIdentity

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 ​

since v2.12

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

csharp
public OpcReadOnlyNamespaceCollection Namespaces { get; }
vbnet
Public ReadOnly Property Namespaces As OpcReadOnlyNamespaceCollection

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.

csharp
public OpcNodeIdFactory NodeIdFactory { get; }
vbnet
Public ReadOnly Property NodeIdFactory As OpcNodeIdFactory

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 ​

since v2.11

Gets the owner of the current OpcContext.

csharp
public IOpcApplicationInstance Owner { get; }
vbnet
Public ReadOnly Property Owner As IOpcApplicationInstance

Property value

IOpcApplicationInstance

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

PreferredLocales ​

virtual · since v2.11

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

csharp
public virtual OpcLocaleCollection PreferredLocales { get; }
vbnet
Public Overridable ReadOnly Property PreferredLocales As OpcLocaleCollection

Property value

OpcLocaleCollection

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

SessionId ​

virtual

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

csharp
public virtual OpcNodeId SessionId { get; }
vbnet
Public Overridable ReadOnly Property SessionId As OpcNodeId

Property value

OpcNodeId

The OpcNodeId of the session.

Methods ​

Enter ​

static · 2 overloads · since v2.40

OverloadDescription
Enter(params OpcNamespace[])static · since v2.40Enters a new OpcContext using the namespaces specified.
Enter(IEnumerable<OpcNamespace>)static · since v2.40Enters a new OpcContext using the namespaces specified.

Enter(params OpcNamespace[]) ​

static · since v2.40

Enters a new OpcContext using the namespaces specified.

csharp
public static OpcContext.Local Enter(params OpcNamespace[] namespaces)
vbnet
Public Shared Function Enter(
    ParamArray namespaces As OpcNamespace()) As OpcContext.Local

Parameters

NameTypeDescription
namespacesparams OpcNamespace[]An array of OpcNamespace instances known by the Namespaces of the new OpcContext to create.

Returns

OpcContext.Local

A new instance of the OpcContext class.

Enter(IEnumerable<OpcNamespace>) ​

static · since v2.40

Enters a new OpcContext using the namespaces specified.

csharp
public static OpcContext.Local Enter(IEnumerable<OpcNamespace> namespaces)
vbnet
Public Shared Function Enter(
    namespaces As IEnumerable(Of OpcNamespace)) As OpcContext.Local

Parameters

NameTypeDescription
namespacesIEnumerable<OpcNamespace>A sequence of OpcNamespace instances known by the Namespaces of the new OpcContext to create.

Returns

OpcContext.Local

A new instance of the OpcContext class.

GetDataType ​

6 overloads · since v2.22

OverloadDescription
GetDataType(string)since v2.22Retrieves the OpcDataTypeInfo object which is known under the name specified.
GetDataType(OpcName)since v2.22Retrieves the OpcDataTypeInfo object which is known under the name specified.
GetDataType(OpcNodeId)since v2.22Retrieves the OpcDataTypeInfo object which declares the type which is identified by the typeId specified.
GetDataType(Type)since v2.22Retrieves the OpcDataTypeInfo object which declares the type implemented by the underlyingType specified.
GetDataType(OpcEncoding)since v2.22Retrieves the OpcDataTypeInfo object which declares the type which is identified by the encoding specified.
GetDataType(XmlQualifiedName)since v2.22Retrieves the OpcDataTypeInfo object which is known under the xmlName specified.

Exceptions (all overloads)

ExceptionCondition
ObjectDisposedExceptionThe object has been disposed of.

GetDataType(string) ​

since v2.22

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

csharp
public OpcDataTypeInfo GetDataType(string name)
vbnet
Public Function GetDataType(name As String) As OpcDataTypeInfo

Parameters

NameTypeDescription
nameStringThe 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

ExceptionCondition
ArgumentExceptionThe name is equals Empty.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).

GetDataType(OpcName) ​

since v2.22

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

csharp
public OpcDataTypeInfo GetDataType(OpcName name)
vbnet
Public Function GetDataType(name As OpcName) As OpcDataTypeInfo

Parameters

NameTypeDescription
nameOpcNameThe 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

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

GetDataType(OpcNodeId) ​

since v2.22

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

csharp
public OpcDataTypeInfo GetDataType(OpcNodeId typeId)
vbnet
Public Function GetDataType(typeId As OpcNodeId) As OpcDataTypeInfo

Parameters

NameTypeDescription
typeIdOpcNodeIdThe 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

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

GetDataType(Type) ​

since v2.22

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

csharp
public OpcDataTypeInfo GetDataType(Type underlyingType)
vbnet
Public Function GetDataType(underlyingType As Type) As OpcDataTypeInfo

Parameters

NameTypeDescription
underlyingTypeTypeThe 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

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

GetDataType(OpcEncoding) ​

since v2.22

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

csharp
public OpcDataTypeInfo GetDataType(OpcEncoding encoding)
vbnet
Public Function GetDataType(encoding As OpcEncoding) As OpcDataTypeInfo

Parameters

NameTypeDescription
encodingOpcEncodingThe 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

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

GetDataType(XmlQualifiedName) ​

since v2.22

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

csharp
public OpcDataTypeInfo GetDataType(XmlQualifiedName xmlName)
vbnet
Public Function GetDataType(xmlName As XmlQualifiedName) As OpcDataTypeInfo

Parameters

NameTypeDescription
xmlNameXmlQualifiedNameThe 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

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

GetNodeType ​

4 overloads · since v2.50

OverloadDescription
GetNodeType(string)since v2.50Retrieves the OpcNodeTypeInfo object which is known under the name specified.
GetNodeType(OpcName)since v2.50Retrieves the OpcNodeTypeInfo object which is known under the name specified.
GetNodeType(OpcNodeId)since v2.50Retrieves the OpcNodeTypeInfo object which declares the type which is identified by the typeId specified.
GetNodeType(Type)since v2.50Retrieves the OpcNodeTypeInfo object which declares the type implemented by the underlyingType specified.

Exceptions (all overloads)

ExceptionCondition
ObjectDisposedExceptionThe object has been disposed of.

GetNodeType(string) ​

since v2.50

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

csharp
public OpcNodeTypeInfo GetNodeType(string name)
vbnet
Public Function GetNodeType(name As String) As OpcNodeTypeInfo

Parameters

NameTypeDescription
nameStringThe 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

ExceptionCondition
ArgumentExceptionThe name is equals Empty.
ArgumentNullExceptionThe name is a null reference (Nothing in Visual Basic).

GetNodeType(OpcName) ​

since v2.50

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

csharp
public OpcNodeTypeInfo GetNodeType(OpcName name)
vbnet
Public Function GetNodeType(name As OpcName) As OpcNodeTypeInfo

Parameters

NameTypeDescription
nameOpcNameThe 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

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

GetNodeType(OpcNodeId) ​

since v2.50

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

csharp
public OpcNodeTypeInfo GetNodeType(OpcNodeId typeId)
vbnet
Public Function GetNodeType(typeId As OpcNodeId) As OpcNodeTypeInfo

Parameters

NameTypeDescription
typeIdOpcNodeIdThe 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

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

GetNodeType(Type) ​

since v2.50

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

csharp
public OpcNodeTypeInfo GetNodeType(Type underlyingType)
vbnet
Public Function GetNodeType(underlyingType As Type) As OpcNodeTypeInfo

Parameters

NameTypeDescription
underlyingTypeTypeThe 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

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

OfNode ​

since v2.50

Creates a context for the node specified which uses the information of the current OpcContext.

csharp
public OpcNodeContext OfNode(OpcNode node)
vbnet
Public Function OfNode(node As OpcNode) As OpcNodeContext

Parameters

NameTypeDescription
nodeOpcNodeThe OpcNode to that the new context belongs.

Returns

OpcNodeContext

A new instance of the OpcNodeContext class for the node.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe node is a null reference (Nothing in Visual Basic).