Expression.Collection Property


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

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Expressions Collection { get; }

Property Value

Type: EnvDTE.Expressions

An Expressions collection.

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.Expression 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: " + 
    owp.OutputString("\nSecond expression: " + exps.Item(2).Name);
Return to top