Process.Collection Process.Collection Process.Collection Process.Collection Property


Returns the collection that contains the object that supports this property or is contained in this code construct. Returns null for an object that is not obtained from a collection.

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

Property Value


The following example demonstrates how to use the Collection property.

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");  
    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 + "  "  
    MessageBox.Show(str, "Process Test - Collection Property")  
End Sub  

Applies to