Debugger.HexDisplayMode 屬性

取得或設定運算式是以十六進位或十進位格式輸出。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
Property HexDisplayMode As Boolean
    Get
    Set
bool HexDisplayMode { get; set; }
property bool HexDisplayMode {
    bool get ();
    void set (bool value);
}
abstract HexDisplayMode : bool with get, set
function get HexDisplayMode () : boolean
function set HexDisplayMode (value : boolean)

屬性值

型別:System.Boolean
如果是十六進位格式,則為 true,否則為 false。

備註

使用 HexDisplayMode 來判斷或設定是否運算式是以十六進位或十進位格式輸出。 HexDisplayMode 會直接對應到 選項對話方塊、偵錯、一般 中的設定。

如需詳細資訊,請參閱偵錯工具中的運算式

範例

下列範例示範如何使用 HexDisplayMode 屬性。

若要測試這個屬性:

  1. 在目標應用程式中設定中斷點。

  2. 在偵錯模式執行目標應用程式。

  3. 當應用程式在中斷點停止時,請執行增益集。

public static void HexDisplayMode(DTE dte)
{
    // Setup the 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("Hex Display Mode Test");
    owp.Activate();

    dte.Debugger.HexDisplayMode = false;
    EnvDTE.Expression exp = dte.Debugger.GetExpression("length", true, 1);
    owp.OutputString("Value of variable length in decimal: " + exp.Value);

    dte.Debugger.HexDisplayMode = true;
    exp = dte.Debugger.GetExpression("length", true, 1);
    owp.OutputString("\nValue of variable length in hex: " + exp.Value);
}
Shared Sub HexDisplayMode(ByRef dte As EnvDTE.DTE)
    Dim exp As EnvDTE.Expression
    dte.Debugger.HexDisplayMode = False
    exp = dte.Debugger.GetExpression("length", True, 1)
    MessageBox.Show("Value of variable length in decimal: " + exp.Value, _
                    "Debugger Test - HexDisplayMode")
    dte.Debugger.HexDisplayMode = True
    exp = dte.Debugger.GetExpression("length", True, 1)
    MessageBox.Show("Value of variable length in hex: " + exp.Value, _
                    "Debugger Test - HexDisplayMode")
End Sub

.NET Framework 安全性

請參閱

參考

Debugger 介面

EnvDTE 命名空間