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 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(
	array<String^>^ key, 
	CacheDataNotificationCallback^ selectiveCacheDataNotificationCallback, 
	EventType eventType, 
	EventDataFilter datafilter
) override

Parameters

key
Type: array<System..::..String>[]()[][]
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