Share via


IWMSCacheProxyCallback.OnRemoveAllCacheItems (Visual Basic .NET)

banner art

Previous Next

IWMSCacheProxyCallback.OnRemoveAllCacheItems (Visual Basic .NET)

The OnRemoveAllCacheItems is called by the cache plug-in to respond when the server calls IWMSCacheProxy.RemoveAllCacheItems.

Syntax

  

Parameters

lHr

[in] Integer 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.

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