MethodDataCollection Sınıf

Tanım

Koleksiyonda kullanılabilen yöntem kümesini temsil eder.

public ref class MethodDataCollection : System::Collections::ICollection
public class MethodDataCollection : System.Collections.ICollection
type MethodDataCollection = class
    interface ICollection
    interface IEnumerable
Public Class MethodDataCollection
Implements ICollection
Devralma
MethodDataCollection
Uygulamalar

Örnekler

Aşağıdaki örnekte sınıfını kullanarak MethodDataWin32_Process.Create yöntemiyle ilgili bilgiler listelenir. Win32_Process sınıfı hakkında daha fazla bilgi için Windows Yönetim Araçları belgelerine bakın.

using System;
using System.Management;

public class Sample
{
    public static void Main()
    {

        // Get the WMI class
        ManagementClass processClass =
            new ManagementClass("Win32_Process");
        processClass.Options.UseAmendedQualifiers = true;

        // Get the methods in the class
        MethodDataCollection methods =
            processClass.Methods;

        // display the method names
        Console.WriteLine("Method Name: ");
        foreach (MethodData method in methods)
        {
            if(method.Name.Equals("Create"))
            {
                Console.WriteLine(method.Name);
                Console.WriteLine("Description: " +
                    method.Qualifiers["Description"].Value);
                Console.WriteLine();

                Console.WriteLine("In-parameters: ");
                foreach(PropertyData i in
                    method.InParameters.Properties)
                {
                    Console.WriteLine(i.Name);
                }
                Console.WriteLine();

                Console.WriteLine("Out-parameters: ");
                foreach(PropertyData o in
                    method.OutParameters.Properties)
                {
                    Console.WriteLine(o.Name);
                }
                Console.WriteLine();

                Console.WriteLine("Qualifiers: ");
                foreach(QualifierData q in
                    method.Qualifiers)
                {
                    Console.WriteLine(q.Name);
                }
                Console.WriteLine();
            }
        }
    }
}
Imports System.Management


Public Class Sample
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer

        ' Get the WMI class
        Dim processClass As ManagementClass = _
            New ManagementClass("Win32_Process")
        processClass.Options.UseAmendedQualifiers = True

        ' Get the methods in the class
        Dim methods As MethodDataCollection = _
            processClass.Methods

        ' display the method names
        Console.WriteLine("Method Name: ")
        For Each method As MethodData In methods

            If (method.Name.Equals("Create")) Then

                Console.WriteLine(method.Name)
                Console.WriteLine("Description: " & _
                    method.Qualifiers("Description").Value)
                Console.WriteLine()

                Console.WriteLine("In-parameters: ")
                For Each i As PropertyData In _
                    method.InParameters.Properties

                    Console.WriteLine(i.Name)
                Next
                Console.WriteLine()

                Console.WriteLine("Out-parameters: ")
                For Each o As PropertyData In _
                    method.OutParameters.Properties

                    Console.WriteLine(o.Name)
                Next
                Console.WriteLine()

                Console.WriteLine("Qualifiers: ")
                For Each q As QualifierData In _
                    method.Qualifiers

                    Console.WriteLine(q.Name)
                Next
                Console.WriteLine()

            End If
        Next

    End Function 'Main
End Class

Özellikler

Count

Koleksiyondaki MethodDataCollection nesne sayısını alır.

IsSynchronized

Nesnenin eşitlenip eşitlenmediğini belirten bir değer alır.

Item[String]

öğesinin belirtilen MethodData değerini MethodDataCollectionalır.

SyncRoot

Eşitleme için kullanılacak nesneyi alır.

Yöntemler

Add(String)

öğesine MethodDataCollectionbir MethodData ekler. Bu aşırı yükleme, koleksiyona parametre içermeyen yeni bir yöntem ekler.

Add(String, ManagementBaseObject, ManagementBaseObject)

öğesine MethodDataCollectionbir MethodData ekler. Bu aşırı yükleme, koleksiyona belirtilen parametre nesneleriyle yeni bir yöntem ekler.

CopyTo(Array, Int32)

öğesini MethodDataCollection bir diziye kopyalar.

CopyTo(MethodData[], Int32)

öğesini MethodDataCollection özel MethodData bir diziye kopyalar.

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetEnumerator()

için MethodDataCollectionbir numaralandırıcı döndürür.

GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
Remove(String)

içinden bir MethodData kaldırır MethodDataCollection.

ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Belirtik Arabirim Kullanımları

IEnumerable.GetEnumerator()

aracılığıyla MethodDataCollectionyineleyen bir IEnumerator döndürür.

Uzantı Metotları

Cast<TResult>(IEnumerable)

öğesinin IEnumerable öğelerini belirtilen türe atar.

OfType<TResult>(IEnumerable)

Bir öğesinin IEnumerable öğelerini belirtilen türe göre filtreler.

AsParallel(IEnumerable)

Sorgunun paralelleştirilmesini sağlar.

AsQueryable(IEnumerable)

bir IEnumerable öğesini öğesine IQueryabledönüştürür.

Şunlara uygulanır