Compartir a través de


Expression.Value (Propiedad)

Establece u obtiene los datos del objeto.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
Property Value As String
string Value { get; set; }
property String^ Value {
    String^ get ();
    void set (String^ value);
}
abstract Value : string with get, set
function get Value () : String 
function set Value (value : String)

Valor de propiedad

Tipo: String
Cadena que representa el valor del objeto.

Comentarios

Si un atributo se presenta en la forma name(someval, 2), entonces el valor será someval, 2.

Ejemplos

En el siguiente ejemplo se muestra cómo utilizar la propiedad Value.

Para probar esta propiedad:

  1. Establezca un punto de interrupción en su aplicación de destino.

  2. Ejecute la aplicación de destino en el modo de depuración.

  3. Cuando la aplicación se detenga en el punto de interrupción, ejecute el complemento.

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

Seguridad de .NET Framework

Vea también

Referencia

Expression Interfaz

EnvDTE (Espacio de nombres)

Otros recursos

Cómo: Compilar y ejecutar los ejemplos de código del modelo de objetos de automatización