Registers the ItemUpdate or ItemRemoved events for the specified key.

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.3.0.0 (4.3.0.0)

Syntax

C#
public override void RegisterCacheNotification(
	string key,
	CacheDataNotificationCallback selectiveCacheDataNotificationCallback,
	EventType eventType,
	EventDataFilter datafilter
)
Visual Basic
Public Overrides Sub RegisterCacheNotification ( 
	key As String,
	selectiveCacheDataNotificationCallback As CacheDataNotificationCallback,
	eventType As EventType,
	datafilter As EventDataFilter
)
Visual C++
public:
virtual void RegisterCacheNotification(
	String^ key, 
	CacheDataNotificationCallback^ selectiveCacheDataNotificationCallback, 
	EventType eventType, 
	EventDataFilter datafilter
) override

Parameters

key
Type: System..::..String
The cache key used to reference the cache item.
selectiveCacheDataNotificationCallback
Type: Alachisoft.NCache.Web.Caching..::..CacheDataNotificationCallback
eventType
Type: Alachisoft.NCache.Runtime.Events..::..EventType
Tells whether the event is to be raised on Item Added, Updated or Removed
datafilter
Type: Alachisoft.NCache.Runtime.Events..::..EventDataFilter
Tells whether to receive metadata, data with metadata or none when a notification is triggered

Examples

First create an ItemCallback
 Copy imageCopy
ItemCallback(string key, CacheEventArg e)
{
   ...
}
Then register the Key Notification
 Copy imageCopy
Cache cache = NCache.InitializeCache("myCache");
cache.RegisterCacheNotification(key, new CacheDataNotificationCallback(ItemCallback), EventType.ItemAdded, EventDataFilter.None);

See Also