IWMSDiagnosticEvent.Type (C#)
.gif)
| Previous | Next |
IWMSDiagnosticEvent.Type (C#)
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
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;
// Retrieve information about each diagnostic event.
for (int i = 0; i < DiagnosticEvents.Count; i++)
{
DiagnosticEvent = DiagnosticEvents[i];
// Retrieve the type of event.
WMS_DIAGNOSTIC_EVENT deType;
deType = DiagnosticEvent.Type;
if (deType == WMS_DIAGNOSTIC_EVENT.WMS_DIAGNOSTIC_EVENT_LIMIT_HIT)
{
// TODO: Handle limit hit events.
}
if (deType ==
WMS_DIAGNOSTIC_EVENT.WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_ERROR)
{
// TODO: Handle event log errors.
}
if (deType ==
WMS_DIAGNOSTIC_EVENT.WMS_DIAGNOSTIC_EVENT_PLUGIN_EVENT_LOG_WARNING)
{
// TODO: Handle event log warnings.
}
}
}
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 |