IWMSCacheProxyCallback.OnRemoveAllCacheItems (C#)
Previous | Next |
IWMSCacheProxyCallback.OnRemoveAllCacheItems (C#)
The OnRemoveAllCacheItems is called by the cache plug-in to respond when the server calls IWMSCacheProxy.RemoveAllCacheItems.
Syntax
Parameters
lHr
[in] int indicating whether the call to IWMSCacheProxy.RemoveAllCacheItems was successful.
varContext
[in] object containing a value defined by the server to identify which call to IWMSCacheProxy.RemoveAllCacheItems the plug-in is responding to when it calls OnRemoveAllCacheItems. You must pass this value back unaltered.
Return Values
This method does not return a value.
Example Code
The following example assumes that the cache plug-in makes use of the .NET DataSet collection of DataTable objects. Each DataRow object in the data table represents one IWMSCacheDescriptor object.
using System.Data; using Microsoft.WindowsMediaServices.Interop; using System.Runtime.InteropServices; void IWMSCacheProxy.RemoveAllCacheItems( IWMSCacheProxyCallback pCallback, object varContext) { try { // Retrieve the cached items DataTable object // from the DataSet object. DataTable dt = DS.Tables["CachedItems"]; // Select and delete all rows. DataRow[] drows = dt.Select(); foreach(DataRow row in drows) { RemoveEntryFromDatabase(); } // Call IWMSCacheProxyCallback.OnRemoceAllCacheItems(). pCallback.OnRemoveAllCacheItems(0,varContext); } catch(Exception e) { throw new COMException(); } return; }
Requirements
Reference: Add a reference to Microsoft.WindowsMediaServices.
Namespace: Microsoft.WindowsMediaServices.Interop.
Assembly: Microsoft.WindowsMediaServices.dll.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.
See Also
Previous | Next |