BVMS Server- and Client-SDK
BVMS Server- and Client-SDK
BVMS Server- and Client-SDK
Bosch.Vms.SDK
EventReceiver Class
EventReceiver Methods
OnEvent Method

# EventReceiverOnEvent Method |

Override this method in your own class derived from EventReceiver. This method is called when an event is fired.
Namespace: Bosch.Vms.SDK
Assembly: Bosch.Vms.SDK (in Bosch.Vms.SDK.dll) Version: 1.9.0.0
Syntax
C#
Copy

    public abstract void OnEvent(
    	EventData eventData
    )

#### Parameters

eventData EventData
  Event data. See SDK dokumentation.

Remarks

Important Note
Do not block in this method. Blocking may cause a connection break or lead to dismissed events.

Example
This sample shows how to implement a custom event receiver class derived from EventReceiver.
C#
Copy

    public class MyReceiver: EventReceiver
    {
        public override void OnEvent(EventData eventData)
        {
            Console.WriteLine(String.Format("Received event '{0}' from device '{1}'", eventData.Type, eventData.DeviceName));
            if (eventData.State.IsValid)
            {
                Console.WriteLine(String.Format("\tState '{0}' changed from '{1}' to '{2}'", eventData.Type, eventData.State.Old, eventData.State.New));
            }
        }
    }

See Also

#### Reference

EventReceiver Class
Bosch.Vms.SDK Namespace
Register(EventReceiver)

Copyright © Bosch Sicherheitssysteme GmbH