Method RaiseCustomEvent
RaiseCustomEvent(Object, Object)
Broadcasts a custom application defined event.
Declaration
public virtual void RaiseCustomEvent(object notifId, object data)
Parameters
Type | Name | Description |
---|---|---|
System.Object | notifId | Application specific notification code/id |
System.Object | data | Application specific data |
Remarks
In most of the cases this method's implementation is close to O(1).
Note: If exceptions are enabled through the ExceptionsEnabled setting, this property throws exception in case of failure.
Note: Custom event notifications can not be disabled through configuration.
Examples
The following example demonstrates how to raise a custom application defined event.
Cache cache = NCache.InitializeCache("myCache");
cache.RaiseCustomEvent(MyNotificationCodes.ConsumeItem,
new ItemData(DateTime.Now));