Share via


IWMSDiagnosticEvents.length (C#)

banner art

Previous Next

IWMSDiagnosticEvents.length (C#)

The length property retrieves the number of IWMSDiagnosticEvent objects contained in the IWMSDiagnosticEvents collection.

Syntax

  int = IWMSDiagnosticEvents.length;

Property Value

int containing the number of IWMSDiagnosticEvent objects.

Remarks

The collection can contain a maximum of 100 IWMSDiagnosticEvent objects. When this limit is reached, the oldest object in the collection is replaced by the newest. Each IWMSDiagnosticEvent object that describes a unique server or publishing point limit is included only once in the collection, but the time and date are updated to reflect the most recent occurrence. For more information, see IWMSDiagnosticEvent.Time and IWMSDiagnosticEvent.NumberOfOccurrences.

This is the JScript version of the IWMSDiagnosticEvents.Count method. It is included for developers who are more comfortable with JScript syntax.

This property is read-only.

Example Code

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

// Declare variables.
WMSServer                   Server;
IWMSDiagnosticEvents        DiagnosticEvents;
IWMSDiagnosticEvent         DiagnosticEvent;

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

    // Retrieve the IWMSDiagnosticEvents object.
    DiagnosticEvents = Server.DiagnosticEvents;

    // Use the length property as an iteration boundary
    // when accessing individual objects in the collection.
    for (int i = 0; i < DiagnosticEvents.length; i++)
    {
        // .
        DiagnosticEvent = DiagnosticEvents[i];
    }
}
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