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
'Usage
Dim instance As Debugger
Dim value As Boolean
value = instance.HexDisplayMode
instance.HexDisplayMode = value
bool HexDisplayMode { get; set; }
property bool HexDisplayMode {
bool get ();
void set (bool value);
}
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:
Set a breakpoint in the target application.
Run the target application in the debug mode.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.