Sdílet prostřednictvím


Expression.Type – vlastnost

Získá Konstanta určující typ objektu.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

'Deklarace
ReadOnly Property Type As String
string Type { get; }
property String^ Type {
    String^ get ();
}
abstract Type : string with get
function get Type () : String

Hodnota vlastnosti

Typ: String
Konstanta řetězce představující typ objektu.

Poznámky

Vrátí řetězec typu výraz jako "int", "CString" nebo "char."

Příklady

Následující příklad demonstruje použití Type vlastnost.

Tato vlastnost testování:

  1. Nastavte zarážky v cílové aplikaci.

  2. Cílová aplikace spouštět v režimu ladění.

  3. Jakmile aplikace přestane u zarážky, spustit doplněk.

public static void Type(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("Type 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 Type(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

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

Expression Rozhraní

EnvDTE – obor názvů

Další zdroje

Postupy: Kompilace a spuštění příkladů kódu objektu automatizace