IWMSCacheItems.Delete (C#)

The Delete method removes an IWMSCacheItemIWMSCacheItem Object (C#) from the IWMSCacheItems collection.

IWMSCacheItems.Delete(
  object  objIndex
);

Arguments

objIndex

[in] object containing the index of the IWMSCacheItem object to be removed.

Return Value

This method does not return a value.

If this method fails, it throws an exception.

Number

Description

0x8002000B

objIndex is an invalid index location.

Example

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer                   Server;
IWMSCacheItems              CacheItems;
IWMSCacheProxyPlugin        CacheProxyPlugin;
IWMSPlugins                 Plugins;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlugins object
    // containing cache proxy plug-ins.
    Plugins = Server.CacheProxy;

    // Retrieve the IWMSCacheProxyPlugin object.
    CacheProxyPlugin = (IWMSCacheProxyPlugin)Plugins[0];

    // Retrieve the IWMSCacheItems object.
    CacheItems = CacheProxyPlugin.CacheItems;

    // Remove the first cache item.
    CacheItems.Delete(0);
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Reference

IWMSCacheItem Object (C#)

IWMSCacheItems Object (C#)

IWMSCacheItems.DeleteAll (C#)