Udostępnij za pośrednictwem


Expression.Value Property

Sets or gets the data for the object.

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

Syntax

'Declaration
Property Value As String
'Usage
Dim instance As Expression 
Dim value As String 

value = instance.Value

instance.Value = value
string Value { get; set; }
property String^ Value {
    String^ get ();
    void set (String^ value);
}
function get Value () : String 
function set Value (value : String)

Property Value

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

Remarks

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

Examples

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: ");
    owp.Activate();

    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);
}
Shared Sub Value(ByRef dte As EnvDTE.DTE)
    Dim exp As EnvDTE.Expression = dte.Debugger.GetExpression("tempC", True, 1)
    Dim str As String
    str = "The name of the expression: " + exp.Name
    str += vbCrLf + "The type of the expression: " + exp.Type
    str += vbCrLf + "The value of the expression: " + exp.Value
    MessageBox.Show(str, "Expression Test - Name, Type, Value Properties")
End Sub

.NET Framework Security

See Also

Reference

Expression Interface

Expression Members

EnvDTE Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples