Condividi tramite


Proprietà Expression.Value

Imposta o ottiene i dati dell'oggetto.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
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)

Valore proprietà

Tipo: System.String
Stringa che rappresenta il valore dell'oggetto.

Note

Se un attributo è nel form name(someval, 2), quindi il valore è someval, 2.

Esempi

Nell'esempio seguente viene illustrato come utilizzare Value proprietà.

Per verificare questa proprietà:

  1. Impostare un punto di interruzione nell'applicazione di destinazione.

  2. Eseguire l'applicazione di destinazione in modalità di debug.

  3. Quando l'applicazione si interrompe al punto di interruzione, eseguire il componente aggiuntivo.

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Expression Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione