OpcEvent Members

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

OpcEvent(IOpcReadOnlyNodeDataStore)

Initializes a new instance of the OpcEvent class using the dataStore specified.

C#

public OpcEvent(IOpcReadOnlyNodeDataStore dataStore)


Parameters

dataStore IOpcReadOnlyNodeDataStore

The IOpcReadOnlyNodeDataStore of the 'Opc.UaFx.OpcEventNode' to represent.


Exceptions

ArgumentNullException

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

TypeResolve

Occurs when the resolution of an event type fails. Use this event to manually provide the Type to use for a specific event type definition identifier.

C#

public static event OpcTypeResolveEventHandler TypeResolve

DataStore

Gets the IOpcReadOnlyNodeDataStore which contains the data of the OpcEvent instance.

C#

protected IOpcReadOnlyNodeDataStore DataStore { get; }


Property Value

IOpcReadOnlyNodeDataStore

An instance implementing the IOpcReadOnlyNodeDataStore interface containing the event data represented by this OpcEvent instance.

EventId

Gets a value generated by the server to uniquely identify a particular event notification.

C#

public byte[] EventId { get; }


Property Value

Byte[]

The identifier of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.EventId'.

EventType

Gets the type of event.

C#

public OpcEventType EventType { get; }


Property Value

OpcEventType

One of the members defined by the OpcEventType enumeration indicating the type of the event represented by the OpcEvent. In case of custom event types the value Event.

EventTypeId

Gets node identifier which describes the specific type of event.

C#

public OpcNodeId EventTypeId { get; }


Property Value

OpcNodeId

The node identifier of the event type. For more information see 'Opc.UaFx.OpcEventNode.EventTypeId'.

Message

Gets a value which defines a human-readable and localizable text description of the event.

C#

public OpcText Message { get; }


Property Value

OpcText

The message of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.Message'.

NodeId

Gets the identifier of the node from which this event data snapshot has been created.

C#

public OpcNodeId NodeId { get; }


Property Value

OpcNodeId

The OpcNodeId of the node this snapshot originates.

ReceiveTime

Gets the time the OPC UA server received the event from the underlying device of another server.

C#

public DateTime ReceiveTime { get; }


Property Value

DateTime

The time the server received the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.ReceiveTime'.

Severity

Gets an indication of the urgency of the event.

C#

public OpcEventSeverity Severity { get; }


Property Value

OpcEventSeverity

The severity of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.Severity'.

SourceName

Gets a description of the source of the event.

C#

public string SourceName { get; }


Property Value

String

The description of the source of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.SourceName'.

SourceNodeId

Gets the node identifier which identifies the node that the event originated from.

C#

public OpcNodeId SourceNodeId { get; }


Property Value

OpcNodeId

The node identifier of the node the OpcEvent originates from. For more information see 'Opc.UaFx.OpcEventNode.SourceNodeId'.

Time

Gets the time the event occurred.

C#

public DateTime Time { get; }


Property Value

DateTime

The time the OpcEvent occurred. For more information see 'Opc.UaFx.OpcEventNode.Time'.

RegisterType<T>()

Registers the type defined by T as the OpcEvent type to create in case there an event instance is to be created for the type definition identified by the OpcEventTypeAttribute defined on the T specified.

C#

public static void RegisterType<T>()
    where T : OpcEvent



Exceptions

ArgumentException

The type T does not define the OpcEventTypeAttribute or a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface or any event type specific attribute offers invalid information about the event type to associate with the Type.

RegisterType<T>(OpcNodeId)

Registers the type defined by T as the OpcEvent type to create in case there an event instance is to be created for the type definition identified by the eventTypeId specified.

C#

public static void RegisterType<T>(OpcNodeId eventTypeId)
    where T : OpcEvent


Parameters

eventTypeId OpcNodeId

The identifier of the type definition for which the T is to be used to create an event instance.



Exceptions

ArgumentException

The type T does not define the OpcEventTypeAttribute or a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface or any event type specific attribute offers invalid information about the event type to associate with the Type.

ArgumentNullException

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


Remarks

It is not possible to register the same or a different event type for the eventTypeId specified as long there is already an event type registered for the type definition specified by eventTypeId.

RegisterTypes(Assembly)

Registers all non-abstract types in the assembly specified which defines the OpcEventTypeAttribute and inherit from OpcEvent.

C#

public static void RegisterTypes(Assembly assembly)


Parameters

assembly Assembly

The Assembly its types are inspected for subclasses of the OpcEvent class which in addition using the OpcEventTypeAttribute.



Exceptions

ArgumentException

A Type does not define the OpcEventTypeAttribute or a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface or any event type specific attribute offers invalid information about the event type to associate with the Type.

ArgumentNullException

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


Remarks

The Type instances to register need to define the OpcEventTypeAttribute and a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface. Additionally the Type needs to be a subclass of the OpcEvent class.

RegisterTypes(IEnumerable<Type>)

Registers the eventTypes specified as the OpcEvent type to create in case there an event instance is to be created for one of the type definitions identified by the OpcEventTypeAttribute used on one of the eventTypes specified.

C#

public static void RegisterTypes(IEnumerable<Type> eventTypes)


Parameters

eventTypes IEnumerable<Type>

A sequence of Type instances representing subclasses of OpcEvent to use in case there an event for the event definition equals to the event type identifier defined using the OpcEventTypeAttribute is to be created.



Exceptions

ArgumentException

A Type does not define the OpcEventTypeAttribute or a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface or any event type specific attribute offers invalid information about the event type to associate with the Type.

ArgumentNullException

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


Remarks

Any null reference (Nothing in Visual Basic) in eventTypes is ignored.

RegisterTypes(Type, Type[])

Registers the eventType and the further specified eventTypes as the OpcEvent types to create in case there an event instance is to be created for one of the type definitions identified by the OpcEventTypeAttribute used on the eventType or on one of the eventTypes specified.

C#

public static void RegisterTypes(Type eventType, params Type[] eventTypes)


Parameters

eventType Type

The Type instance representing a subclass of the OpcEvent to use in case there an event for the event definition equals to the event type identifier defined using the OpcEventTypeAttribute is to be created.

eventTypes Type[]

An array of additional Type instances representing subclasses of OpcEvent to use in case there an event for the event definition equals to the event type identifier defined using the OpcEventTypeAttribute is to be created.



Exceptions

ArgumentException

A Type does not define the OpcEventTypeAttribute or a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface or any event type specific attribute offers invalid information about the event type to associate with the Type.

ArgumentNullException

The eventType or eventTypes is a null reference (Nothing in Visual Basic).

UnregisterType<T>()

Unregisters the previously registered (see RegisterType´´1) type defined by T as the OpcEvent type to not longer create for the type definition identified by the OpcEventTypeAttribute defined on the T specified.

C#

public static void UnregisterType<T>()
    where T : OpcEvent

UnregisterType<T>(OpcNodeId)

Unregisters the previously registered (see RegisterType´´1(OpcNodeId)) type defined by T as the OpcEvent type to not longer create for the type definition identified by the eventTypeId specified.

C#

public static void UnregisterType<T>(OpcNodeId eventTypeId)
    where T : OpcEvent


Parameters

eventTypeId OpcNodeId

The identifier of the type definition for which the T is to be unregistered.



Exceptions

ArgumentNullException

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

UnregisterTypes(Assembly)

Unregisters all previously registered types (see RegisterTypes(Assembly)) in the assembly specified.

C#

public static void UnregisterTypes(Assembly assembly)


Parameters

assembly Assembly

The Assembly its types are inspected for subclasses of the OpcEvent class which in addition using the OpcEventTypeAttribute.



Exceptions

ArgumentNullException

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

UnregisterTypes(IEnumerable<Type>)

Unregisters the previously registered (see RegisterTypes(IEnumerable)) eventTypes specified.

C#

public static void UnregisterTypes(IEnumerable<Type> eventTypes)


Parameters

eventTypes IEnumerable<Type>

A sequence of OpcEvent types to unregister for the event definitions equals to the event type identifiers defined using the OpcEventTypeAttribute.



Exceptions

ArgumentNullException

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

UnregisterTypes(Type, Type[])

Unregisters the previously registered eventType and the further specified eventTypes (see RegisterTypes(Type, Type)).

C#

public static void UnregisterTypes(Type eventType, params Type[] eventTypes)


Parameters

eventType Type

The OpcEvent type to unregister for the event definition equals to the event type identifier defined using the OpcEventTypeAttribute.

eventTypes Type[]

An array of additional OpcEvent types to unregister for the event definitions equals to the event type identifiers defined using the OpcEventTypeAttribute.



Exceptions

ArgumentNullException

The eventType or eventTypes is a null reference (Nothing in Visual Basic).