EventAttribute is the schema attribute used to register database events on classes, interfaces, fields, or properties. It associates an application-visible event name with an EventType value and makes that event available to runtime handlers such as WaitEvent(), AsyncEvent, and related C# event-listener APIs.
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface |
AttributeTargets.Field | AttributeTargets.Property,
AllowMultiple = true)]
public class EventAttribute : Attribute
{
public string Name { get; set; }
public EventType Type { get; set; }
public EventAttribute(string name, EventType type);
}
EventType.Connection.WaitEvent().AllowMultiple = true, more than one EventAttribute can be attached to the same class when the application needs to react to several event types.EventType.OnFieldUpdate is intended for field or property declarations. Other event types are typically declared at the class level.[Event("NewEvent", EventType.OnNew)] or annotate a field with [Event("FieldUpdateEvent", EventType.OnFieldUpdate)], then wait for the event by name from a dedicated listener thread or delegate-based event handler.EventType values and Using eXtremeDB Database Events and Time-To-Live Features in C# for event-handling workflow and examples.