Expression2.Collection Property

Definition

Gets the collection containing the object supporting this property or contained within this code construct.

C++
public:
 property EnvDTE::Expressions ^ Collection { EnvDTE::Expressions ^ get(); };

Property Value

An Expressions collection.

Implements

Attributes

Examples

The following example demonstrates how to use the Collection property.

C#
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();  

    EnvDTE100.Expression2 exp = dte.Debugger.GetExpression("a", true, 1);  
    EnvDTE.Expressions exps = exp.DataMembers;  
    owp.OutputString("\nExpression count: " + exps.Count);  
    owp.OutputString("\nEdition of the environment: " + exps.DTE.Edition);  
    owp.OutputString("\nThe name of the current program: " +   
                     exps.Parent.CurrentProgram.Name);  
    owp.OutputString("\nSecond expression: " + exps.Item(2).Name);  
}  

Applies to

Produkt Wersje
Visual Studio SDK 2015, 2017, 2019, 2022