IWMSDiagnosticEvent.Type (Visual Basic .NET)

banner art

Previous Next

IWMSDiagnosticEvent.Type (Visual Basic .NET)

The Type property retrieves an enumeration value indicating the type of the event notice.

Syntax

  WMS_DIAGNOSTIC_EVENT = IWMSDiagnosticEvent.Type

Property Value

A member of a WMS_DIAGNOSTIC_EVENT enumeration type indicating the type of the event. This must be one of the following values.

Value Description
WMS_DIAGNOSTIC_EVENT_LIMIT_HIT The event is a limit hit event.
WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_ERROR The event was raised because a plug-in wrote a WMS_EVENT_LOG_LEVEL_ERROR to the Windows event log. The server automatically disables the plug-in when this type of event is logged.
WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_WARNING The event was raised because a plug-in wrote a WMS_EVENT_LOG_LEVEL_WARNING to the Windows event log.
WMS_DIAGNOSTIC_EVENT_SERVER_EVENT_LOG_ERROR The event was raised because the server wrote a WMS_EVENT_LOG_LEVEL_ERROR to the Windows event log.
WMS_DIAGNOSTIC_EVENT_SERVER_EVENT_LOG_WARNING The event was raised because the server wrote a WMS_EVENT_LOG_LEVEL_WARNING to the Windows event log.

Remarks

This property is read-only.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetEventType()

    ' Declare variables.
    Dim Server As WMSServer
    Dim DiagnosticEvents As IWMSDiagnosticEvents
    Dim DiagnosticEvent As IWMSDiagnosticEvent
    Dim deType As WMS_DIAGNOSTIC_EVENT

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSDiagnosticEvents object.
    DiagnosticEvents = Server.DiagnosticEvents

    ' Retrieve information about each diagnostic event.
    For Each DiagnosticEvent In DiagnosticEvents

        ' Retrieve the type of event.
        deType = DiagnosticEvent.Type
        If deType = WMS_DIAGNOSTIC_EVENT.WMS_DIAGNOSTIC_EVENT_LIMIT_HIT Then
            ' TODO: Handle limit hit events.
       End If

        If deType = WMS_DIAGNOSTIC_EVENT.WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_ERROR Then
            ' TODO: Handle event log errors.
       End If

        If deType = WMS_DIAGNOSTIC_EVENT.WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_WARNING Then
            ' TODO: Handle event log warnings.
       End If

    Next

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

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