MethodDataCollection MethodDataCollection MethodDataCollection MethodDataCollection Class

定義

コレクションで使用できる一連のメソッドを表します。Represents the set of methods available in the collection.

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
継承
MethodDataCollectionMethodDataCollectionMethodDataCollectionMethodDataCollection
実装

次の例では、 MethodDataクラスを使用して、 Win32_Processメソッドに関する情報を一覧表示します。The following example lists information about the Win32_Process.Create method using the MethodData class. Win32_Processクラスの詳細については、 Windows Management Instrumentationのドキュメントを参照してください。For more information on the Win32_Process class, see the Windows Management Instrumentation documentation.

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

プロパティ

Count Count Count Count

MethodDataCollection コレクション内のオブジェクトの数を取得します。Gets the number of objects in the MethodDataCollection collection.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

オブジェクトの同期がとられているかどうかを示す値を取得します。Gets a value that indicates whether the object is synchronized.

Item[String] Item[String] Item[String] Item[String]

指定した MethodDataMethodDataCollection から取得します。Gets the specified MethodData from the MethodDataCollection.

SyncRoot SyncRoot SyncRoot SyncRoot

同期に使用するオブジェクトを取得します。Gets the object to be used for synchronization.

メソッド

Add(String) Add(String) Add(String) Add(String)

MethodDataMethodDataCollection に追加します。Adds a MethodData to the MethodDataCollection. このオーバーロードは、パラメーターのない新しいメソッドをコレクションに追加します。This overload will add a new method with no parameters to the collection.

Add(String, ManagementBaseObject, ManagementBaseObject) Add(String, ManagementBaseObject, ManagementBaseObject) Add(String, ManagementBaseObject, ManagementBaseObject) Add(String, ManagementBaseObject, ManagementBaseObject)

MethodDataMethodDataCollection に追加します。Adds a MethodData to the MethodDataCollection. このオーバーロードは、指定したパラメーター オブジェクトを持つ新しいメソッドをコレクションに追加します。This overload will add a new method with the specified parameter objects to the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

MethodDataCollection を配列にコピーします。Copies the MethodDataCollection into an array.

CopyTo(MethodData[], Int32) CopyTo(MethodData[], Int32) CopyTo(MethodData[], Int32) CopyTo(MethodData[], Int32)

MethodDataCollection を特別な MethodData 配列にコピーします。Copies the MethodDataCollection to a specialized MethodData array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

MethodDataCollection の列挙子を返します。Returns an enumerator for the MethodDataCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(String) Remove(String) Remove(String) Remove(String)

MethodData から MethodDataCollection を削除します。Removes a MethodData from the MethodDataCollection.

ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)

明示的なインターフェイスの実装

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

MethodDataCollection を反復処理する IEnumerator を返します。Returns an IEnumerator that iterates through the MethodDataCollection.

拡張メソッド

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable の要素を、指定した型にキャストします。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

指定された型に基づいて IEnumerable の要素をフィルター処理します。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

クエリの並列化を有効にします。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerableIQueryable に変換します。Converts an IEnumerable to an IQueryable.

適用対象