How does the Visual Studio debugger decide what values ​​can be viewed using the Text / XML / HTML Visualizer?

I noticed that when I look at variables of certain types, for example XElement , in the viewport in Visual Studio, if I click on the magnifying glass of Debug Visualizer, the same visualizers will appear that apply to strings (text, XML, HTML). I have not seen this before. How did the debugger decide to do this?

EDIT: here is a screenshot from the Clock window demonstrating that XElement will be displayed using Text Visualizer, and System.Version (which also implements ToString) will not. enter image description here

+4
source share
2

, , .

, XML HTML , , . IDebugProperty2::GetPropertyInfo DBG_ATTRIB_VALUE_RAW_STRING , . , IDebugProperty3::GetStringChars / GetStrigCharLength, .

, , , . MSDN , ,

http://msdn.microsoft.com/en-us/library/vstudio/bb162331 (v = vs .100).aspx http://msdn.microsoft.com/en-us/library/vstudio/bb146621 (v = vs .100).aspx

, : Version vs. XElement. , , , , . #, , XElement, VB.Net XElement, Version. , EE,

#

String XNode, .

XElement XNode, , . Version XNode, String,

VB.Net

,

  • String ToString
  • DebuggerDisplay, , 1 2

XElement Version ToString,

?

. VB.Net, ( ). , , String, . #, . , , , :)

+4

?

.

.

, . VS .

0

Source: https://habr.com/ru/post/1529280/


All Articles