次の方法で共有


Expression.Type Property

Definition

Gets a constant indicating the object type.

public:
 property System::String ^ Type { System::String ^ get(); };
public:
 property Platform::String ^ Type { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(100)]
public string Type { [System.Runtime.InteropServices.DispId(100)] get; }
[<System.Runtime.InteropServices.DispId(100)>]
[<get: System.Runtime.InteropServices.DispId(100)>]
member this.Type : string
Public ReadOnly Property Type As String

Property Value

A string constant representing the object type.

Attributes

Examples

The following example demonstrates how to use the Type property.

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  

Remarks

Returns a string of the type of expression, such as "int", "CString", or "char."

Applies to