Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MethodDataCollection Class

Represents the set of methods available in the collection.

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

System.Object
   System.Management.MethodDataCollection

[Visual Basic]
Public Class MethodDataCollection
   Implements ICollection, IEnumerable
[C#]
public class MethodDataCollection : ICollection, IEnumerable
[C++]
public __gc class MethodDataCollection : public ICollection,
   IEnumerable
[JScript]
public class MethodDataCollection implements ICollection,
   IEnumerable

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 enumerate all methods in a ManagementClass object.
class Sample_MethodDataCollection
{
    public static int Main(string[] args) {
        ManagementClass diskClass = new ManagementClass("win32_logicaldisk");
        MethodDataCollection diskMethods = diskClass.Methods;
        foreach (MethodData method in diskMethods) {
            Console.WriteLine("Method = " + method.Name);
        }
        return 0;
    }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This sample demonstrates enumerate all methods in a ManagementClass object.
Class Sample_MethodDataCollection
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim diskClass As New ManagementClass("win32_logicaldisk")
        Dim diskMethods As MethodDataCollection = diskClass.Methods
        Dim method As MethodData
        For Each method In diskMethods
            Console.WriteLine("Method = " & method.Name)
        Next method
        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 Members | System.Management Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.