Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MethodDataCollection.MethodDataEnumerator Class

Represents the enumerator for MethodData objects in the MethodDataCollection.

For a list of all members of this type, see MethodDataCollection.MethodDataEnumerator Members.

System.Object
   System.Management.MethodDataCollection.MethodDataEnumerator

[Visual Basic]
Public Class MethodDataCollection.MethodDataEnumerator
   Implements IEnumerator
[C#]
public class MethodDataCollection.MethodDataEnumerator :
   IEnumerator
[C++]
public __gc class MethodDataCollection.MethodDataEnumerator :
   public IEnumerator
[JScript]
public class MethodDataCollection.MethodDataEnumerator implements
   IEnumerator

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Example

[C#] 
using System;
using System.Management;

// This sample demonstrates how to enumerate all methods in
// Win32_LogicalDisk class using MethodDataEnumerator object.

class Sample_MethodDataEnumerator 
{
 public static int Main(string[] args) 
 {
  ManagementClass diskClass = new ManagementClass("win32_logicaldisk");
  MethodDataCollection.MethodDataEnumerator diskEnumerator = 
   diskClass.Methods.GetEnumerator();
  while(diskEnumerator.MoveNext()) 
  {
   MethodData method = diskEnumerator.Current;
   Console.WriteLine("Method = " + method.Name);
  }   
  return 0;
 }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This sample demonstrates how to enumerate all methods in
' Win32_LogicalDisk class using MethodDataEnumerator object.

Class Sample_MethodDataEnumerator
 Overloads Public Shared Function Main(args() As String) As Integer
  Dim diskClass As New ManagementClass("win32_logicaldisk")
  Dim diskEnumerator As _
       MethodDataCollection.MethodDataEnumerator = _
      diskClass.Methods.GetEnumerator()
  While diskEnumerator.MoveNext()
   Dim method As MethodData = diskEnumerator.Current
   Console.WriteLine("Method = " & method.Name)
  End While
  Return 0
 End Function 
End Class
   

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Management

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Management (in System.Management.dll)

See Also

MethodDataCollection.MethodDataEnumerator Members | System.Management Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft