Share via


IWMSDiagnosticEvent.NumberOfOccurrences (C#)

banner art

Previous Next

IWMSDiagnosticEvent.NumberOfOccurrences (C#)

The NumberOfOccurrences property retrieves the number of times the event notice has occurred.

Syntax

  int = IWMSDiagnosticEvent.NumberOfOccurrences;

Property Value

int containing the number of times the event notice has occurred.

Remarks

The NumberOfOccurrences property is relevant only for limit events. When a limit event occurs, the value is incremented and the IWMSDiagnosticEvent.Time value is updated.

This property is read-only.

Example Code

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

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

int                        iCount;

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

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

    // Retrieve information about each diagnostic event.
    for (int i = 0; i < DiagnosticEvents.Count; i++)
    {
        DiagnosticEvent = DiagnosticEvents[i];

        // Retrieve the number of times this event occurred.
        iCount = DiagnosticEvent.NumberOfOccurrences;
    }
}
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