Share via


IWMSAnnouncementStreamFormats.Remove (C#)

banner art

Previous Next

IWMSAnnouncementStreamFormats.Remove (C#)

The Remove method removes an item, by index, from the IWMSAnnouncementStreamFormats collection.

  • Note   This method is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; and Windows Server 2008.

Syntax

  IWMSAnnouncementStreamFormats
  .Remove(
  object  objIndex
);

Parameters

objIndex

[in] object containing the index of the item to remove.

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;
IWMSPublishingPoints             PubPoints;
IWMSPublishingPoint              PubPoint;
IWMSBroadcastPublishingPoint     BCPubPoint;
IWMSAnnouncementStreamFormats    AnnounceStreamFormats;

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

    // Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints;

    // Retrieve each publishing point and retrieve the
    // IWMSBroadcastPublishingPoint object.
    for (int i = 0; i < PubPoints.Count; i++)
    {
        PubPoint = PubPoints[i];

        if (PubPoint.Type ==  
            WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST)
        {
            BCPubPoint = (IWMSBroadcastPublishingPoint)PubPoint;

            // Retrieve the IWMSAnnouncementStreamFormats object.
            AnnounceStreamFormats = BCPubPoint.AnnouncementStreamFormats;

            // Remove the first file from the
            // IWMSAnnouncementStreamFormats object.
            AnnounceStreamFormats.Remove(i);
            break;
        }
    }
}
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