Process.Collection Eigenschaft

Definition

Gibt die Auflistung mit dem Objekt zurück, das diese Eigenschaft unterstützt oder das in diesem Codekonstrukt enthalten ist. Gibt Null für Objekte zurück, die nicht aus einer Auflistung abgerufen werden.

public:
 property EnvDTE::Processes ^ Collection { EnvDTE::Processes ^ get(); };
[System.Runtime.InteropServices.DispId(202)]
public EnvDTE.Processes Collection { [System.Runtime.InteropServices.DispId(202)] get; }
[<System.Runtime.InteropServices.DispId(202)>]
[<get: System.Runtime.InteropServices.DispId(202)>]
member this.Collection : EnvDTE.Processes
Public ReadOnly Property Collection As Processes

Eigenschaftswert

Processes

Eine Processes-Auflistung.

Attribute

Beispiele

Im folgenden Beispiel wird die Verwendung der- Collection Eigenschaft veranschaulicht.

public static void Collection(DTE dte)  
{  
    // Setup debug Output window.  
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);  
    w.Visible = true;  
    OutputWindow ow = (OutputWindow)w.Object;  
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Collection Property Test");  
    owp.Activate();  

    EnvDTE.Process process = dte.Debugger.LocalProcesses.Item(1);  
    owp.OutputString("Number of items in the process collection is " +   
        process.Collection.Count + ": ");  
    foreach(EnvDTE.Process proc in process.Collection)  
        owp.OutputString("\n" + proc.Name + "  ");  
}  
Shared Sub Collection(ByRef dte As EnvDTE.DTE)  
    Dim process As EnvDTE.Process = dte.Debugger.LocalProcesses.Item(1)  
    Dim str As String = vbCrLf  
    str = "There are " + process.Collection.Count.ToString()  
    str += " items in the process collection: "  
    For Each proc As EnvDTE.Process In process.Collection  
        str += vbCrLf + proc.Name + "  "  
    Next  
    MessageBox.Show(str, "Process Test - Collection Property")  
End Sub  

Gilt für