Share via


IWMSCacheItems.Delete (C#)

banner art

Previous Next

IWMSCacheItems.Delete (C#)

The Delete method removes an IWMSCacheItem object from the IWMSCacheItems collection.

Syntax

  IWMSCacheItems
  .Delete(
  object  objIndex
);

Parameters

objIndex

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

Return Values

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 Code

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

Previous Next