Export (0) Print
Expand All

Expression.Value Property

Sets or gets the data for the object.

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

string Value { get; set; }

Property Value

Type: System.String
A string representing the value of the object.

If an attribute is in the form name(someval, 2), then the value is someval, 2.

The following example demonstrates how to use the Value property.

To test this property:

  1. Set a breakpoint in your target application.

  2. Run the target application in the debug mode.

  3. When the application stops at the breakpoint, run the add-in.

public static void Value(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("Value property: ");

    EnvDTE.Expression exp = dte.Debugger.GetExpression("tempC", true, 1);
    owp.OutputString("\nThe name of the expression: " + exp.Name);
    owp.OutputString("\nThe type of the expression: " + exp.Type);
    owp.OutputString("\nThe value of the expression: " + exp.Value);

© 2015 Microsoft