Registers the ItemUpdate or ItemRemoved events for the specified keys.

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 virtual void RegisterCacheNotification(
	string[] keys,
	CacheDataNotificationCallback selectiveCacheDataNotificationCallback,
	EventType eventType,
	EventDataFilter datafilter
)
Visual Basic
Public Overridable Sub RegisterCacheNotification ( 
	keys As String(),
	selectiveCacheDataNotificationCallback As CacheDataNotificationCallback,
	eventType As EventType,
	datafilter As EventDataFilter
)
Visual C++
public:
virtual void RegisterCacheNotification(
	array<String^>^ keys, 
	CacheDataNotificationCallback^ selectiveCacheDataNotificationCallback, 
	EventType eventType, 
	EventDataFilter datafilter
)

Parameters

keys
Type: array<System..::..String>[]()[][]
An array of cache keys used to reference the cache items.
selectiveCacheDataNotificationCallback
Type: Alachisoft.NCache.Web.Caching..::..CacheDataNotificationCallback
eventType
Type: Alachisoft.NCache.Runtime.Events..::..EventType
Tells whether the event is to be raised on item updated or removed
datafilter
Type: Alachisoft.NCache.Runtime.Events..::..EventDataFilter
This enum is to describe when registering an event, upon raise how much data is retrieved from cache when the event is raised

Examples

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

See Also