Delegate CacheStoppedCallback
Defines a callback method for notifying applications when the Cache is stopped.
Namespace:
Assembly: Alachisoft.NCache.Web.dll
Syntax
public delegate void CacheStoppedCallback(string cacheId);
Parameters
Type | Name | Description |
---|---|---|
System.String | cacheId | The Identification of the cache being stopped. It is helpful as multiple cache instances can exists with in the same application. |
Remarks
This handler is invoked when a Cache is stopped.
Examples
The following example demonstrates how to use the CacheStoppedCallback class to notifiy an application when a cache is stopped. You could include this code in a code declaration block in the Web Forms page, or in a page code-behind file.
public void OnCacheStopped(string cacheId)
{
// ...
}
protected void Application_Start(object sender, EventArgs e)
{
try
{
NCache.InitializeCache("myCache");
NCache.Cache.CacheStopped += new CacheStoppedCallback(this.OnCacheStopped);
}
catch(Exception e)
{
}
}