This documentation is archived and is not being maintained.
InstrumentationType Enumeration
Visual Studio 2008
Specifies the type of instrumentation provided by a class.
Assembly: System.Management (in System.Management.dll)
The following example demonstrates how to create a management event class by using the InstrumentationType enumeration.
Imports System Imports System.Management Imports System.Configuration.Install Imports System.Management.Instrumentation ' This sample demonstrates how to create ' a management event class by using ' the InstrumentationType enumeration ' Specify which namespace the management event ' class is created in <Assembly: Instrumented("Root/Default")> ' Let the system know InstallUtil.exe tool will ' be run against this assembly <System.ComponentModel.RunInstaller(True)> _ Public Class MyInstaller Inherits DefaultManagementProjectInstaller End Class 'MyInstaller Namespace WMISample ' Create a management instrumentation event class <InstrumentationClass(InstrumentationType.Event)> _ Public Class MyEvent Private EventName As String Function setEventName(ByVal name As String) EventName = name End Function End Class Public Class SampleEventProvider Public Shared Function Main(ByVal args() _ As String) As Integer Dim e As New MyEvent e.setEventName("Hello") ' Fire a management event System.Management.Instrumentation. _ Instrumentation.Fire(e) Return 0 End Function End Class End Namespace
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: