Creating Custom Events

You can create custom events with the ClientEvent alert.

  1. Initiate the service and send the custom client event:

    var service = new BusinessEventService();
    
    service.PostBusinessEvent(new CoolNewCustomCompanyEvent
    {
            EventProperty1 = "The first thing",
            EventProperty2 = 42,
            EventProperty3 = true,
            EventProperty4 = { "CoolData": "Hello" }
    });
    
  2. To create a custom event, replace the EventProperty{#} with your data of any type:

    private class CoolNewCustomCompanyEvent : ClientEvent
        {
            public string EventProperty1 { get; set; }
            public int EventProperty2 { get; set; }
            public bool EventProperty3 { get; set; }
            Public Dictionary<string, object> EventProperty4 { get; set; }
        }
    

Did this page help you?