Debugger.HexInputMode 属性

获取或设置是以十六进制还是以十进制格式计算表达式。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Property HexInputMode As Boolean
bool HexInputMode { get; set; }
property bool HexInputMode {
    bool get ();
    void set (bool value);
}
abstract HexInputMode : bool with get, set
function get HexInputMode () : boolean 
function set HexInputMode (value : boolean)

属性值

类型:Boolean
如果采用十六进制格式,则为 true,否则为 false。

备注

使用 HexInputMode 来确定或设置是以十六进制还是以十进制格式计算表达式。 HexInputMode 与 “选项”对话框 ->“调试”->“常规” 中的设置直接对应。

有关更多信息,请参见调试器中的表达式

示例

下面的示例演示如何使用 HexInputMode 属性。

测试此属性:

  1. 在目标应用程序中设置一个断点。

  2. 以调试模式运行目标应用程序。

  3. 当此应用程序停在该断点处时,运行外接程序。

public static void HexInputMode(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 Input Mode Test");
    owp.Activate();

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

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

.NET Framework 安全性

请参阅

参考

Debugger 接口

EnvDTE 命名空间