Поделиться через


Debugger.HexDisplayMode Property

Gets or sets whether expressions are output in hexadecimal or decimal format.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Property HexDisplayMode As Boolean
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)

Property Value

Type: System.Boolean
true if hexadecimal format, otherwise false.

Remarks

Use HexDisplayMode to determine or set whether expressions are output in hexadecimal or decimal format. HexDisplayMode directly corresponds to the setting in the General, Debugging, Options Dialog Box.

See Expressions in the Debugger for more information.

Examples

The following example demonstrates how to use the HexDisplayMode property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Run the target application in the debug mode.

  3. When the application stops at the breakpoint, run the add-in.

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 Security

See Also

Reference

Debugger Interface

EnvDTE Namespace