Share via


IWMSCacheProxy.RemoveAllCacheItems (Visual Basic .NET)

banner art

Previous Next

IWMSCacheProxy.RemoveAllCacheItems (Visual Basic .NET)

The RemoveAllCacheItems method is called by the server to remove all content from the cache.

Syntax

  

Parameters

pCallback

[in] IWMSCacheProxyCallback object containing the callback function.

varContext

[in] Object containing a value defined by the server to identify which call to RemoveAllCacheItems the plug-in is responding to when it calls IWMSCacheProxyCallback.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.

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Public Sub RemoveAllCacheItems(ByVal Callback As IWMSCacheProxyCallback, ByVal varContext As Object) _
  Implements IWMSCacheProxy.RemoveAllCacheItems

    Dim DT As DataTable
    Dim DRows() As DataRow
    Dim Row As DataRow

    Try
        ' Retrieve the cached items DataTable object
        ' from the DataSet object.
        DT = DS.Tables("CachedItems")

        ' Select and delete all rows.
        DRows = DT.Select()
        For Each Row In DRows
            'RemoveEntryFromDatabase()
        Next

        ' Call IWMSCacheProxyCallback.OnRemoceAllCacheItems().
        Callback.OnRemoveAllCacheItems(0, varContext)

    Catch
        Throw New COMException()
    End Try

End Sub

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