DataCache.AddRegionLevelCallback Method
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Adds a cache notification callback for cache operations occurring on one specific region.
Namespace: Microsoft.Data.Caching
Assembly: ClientLibrary (in clientlibrary.dll)
Syntax
'Declaration
Public Overridable Function AddRegionLevelCallback ( _
regionName As String, _
filter As DataCacheOperation, _
clientCallback As DataCacheNotificationCallback _
) As DataCacheNotificationDescriptor
'Usage
Dim instance As DataCache
Dim regionName As String
Dim filter As DataCacheOperation
Dim clientCallback As DataCacheNotificationCallback
Dim returnValue As DataCacheNotificationDescriptor
returnValue = instance.AddRegionLevelCallback(regionName, filter, clientCallback)
public virtual DataCacheNotificationDescriptor AddRegionLevelCallback (
string regionName,
DataCacheOperation filter,
DataCacheNotificationCallback clientCallback
)
public:
virtual DataCacheNotificationDescriptor^ AddRegionLevelCallback (
String^ regionName,
DataCacheOperation filter,
DataCacheNotificationCallback^ clientCallback
)
public DataCacheNotificationDescriptor AddRegionLevelCallback (
String regionName,
DataCacheOperation filter,
DataCacheNotificationCallback clientCallback
)
public function AddRegionLevelCallback (
regionName : String,
filter : DataCacheOperation,
clientCallback : DataCacheNotificationCallback
) : DataCacheNotificationDescriptor
Parameters
- regionName
The name of the region for which the specified item or region operations can trigger cache notifications.
- filter
The type of cache operation(s) that will trigger cache notifications.
- clientCallback
The name of the method you want to invoke when these notifications occur.
Return Value
A DataCacheNotificationDescriptor object used to identify the cache notification callback.
Remarks
Use the DataCacheOperation enumeration in the filter parameter to specify what type of item operations you want to trigger cache notifications. Select more than one enumeration by separating the enumerations with the binary OR operator to perform a bitwise OR. To do this, use the |
character in C#, and the Or
operator in Visual Basic.
The clientCallback method you invoke with the cache notification must accept the same parameters as the DataCacheNotificationCallback delegate.
For more information about using this method, see How to: Add a Cache Notification Callback (Velocity). For more information about cache notifications, see Cache Notifications (Velocity).
Note
In order for your application to use notifications, you need to enable them on a named cache. Use the notificationsEnabled
parameter with the New-Cache
or Set-CacheConfig
commands. For more information, see Cache Administration with PowerShell (Velocity).
See Also
Reference
DataCache Class
DataCache Members
Microsoft.Data.Caching Namespace