資料視覺效果Data visualizations

Visual Studio for Mac 包含支援偵錯工具的 UI,允許在偵錯時將變數、欄位或屬性值視覺化。Visual Studio for Mac includes UI support for the debugger, allowing visualizations of the values of a variable, field, or property while debugging. 這些資料視覺化檢視會顯示資料的擴充版本,且可讓開發人員檢查已知的結構,例如顯示色彩結構的色彩。These data visualizers show an extended version of the data and allow developers to inspect known structures, for example showing the color of a color struct.

當使用者將滑鼠停留在資料列上時,按一下出現在值右邊的 [預覽] 圖示,即可顯示 [偵錯工具 區域變數 ] 視窗中的視覺化檢視。Visualizers in the debug Locals window can be displayed by clicking on the preview icon that appears to the right of the value, when the user hovers over the row:

本機視窗

下列清單列出在 Visual Studio for Mac 中進行偵錯時可用的許多新視覺效果。The list below looks at many of the new visualizations available when debugging in Visual Studio for Mac.

PointPoint

在 iOS 和 Mac 中,點/PointF (或 CGPoint)會轉譯為一個元組,顯示調試時間視窗中的 X 和 Y 值:A Point/PointF, or CGPoint in iOS and Mac, will render as a tuple showing the X and Y values in the debug windows:

點視覺效果

大小Size

Size/SizeF 或 iOS 和 Mac 中的 CGSize 會轉譯為矩形。A Size/SizeF, or CGSize in iOS and Mac, will render as a rectangle. 將進行繪製以擴展直到尺寸的增長超過 250 px 為止,此時會將矩形擴展為最大尺寸 250 px:It is drawn to scale until a dimension grows past 250 px, at which point it will scale the rectangle with the largest dimension as 250 px:

大小視覺效果Size Visualization

矩形Rectangle

Rectangle/RectangleF 或 iOS 和 Mac 的 CGRect 會顯示尺寸和原點。A Rectangle/RectangleF, or CGRect in iOS and Mac, will display the dimensions and origin. 與大小類似,將會進行繪製以擴展直到尺寸的增長超過 250 px 為止:Similar to Size, it is drawn to scale, until a dimension grows past 250 px:

矩形視覺效果

座標Coordinate

座標會繪製在地圖上,並將位置釘選到中央:Coordinates are plotted on a map, with the location pinned to the center:

座標視覺效果Coordinate Visualization

色彩Color

這會顯示 UIColor、CGColor 和 Color 屬性,用來描述彩色預覽、RGBA 元件、色調-飽和-亮度值和色彩的十六進位值:This will display UIColor, CGColor, and Color properties, depicting the color preview, RGBA components, Hue-Saturation-Lightness values, and the hex value of the color:

色彩視覺效果

影像Images

媒體呈現時最多擴展為最大尺寸 250 px,並且將在影像超過 250 px 時進行縮放以符合大小:Media will be rendered to scale, up to a maximum dimension of 250 px, and will be scaled to fit when the image exceeds 250 px:

影像視覺效果

貝茲曲線Bezier Curves

視覺化檢視將顯示 NSBezierPathThe visualizer will display an NSBezierPath:

貝茲曲線視覺效果

StringString

少於 100 個字元的字串會完整顯示,而不進行預覽。A string of fewer than 100 characters is displayed in full, without a preview. 較長的字串會在預覽中完整顯示。Longer strings are displayed in full in the preview. 字串可進行編輯,且視覺化檢視會伴隨顯示 [編輯] 按鈕,讓您能夠在預覽或字串值編輯器中編輯字串值,如下所示:Strings are editable, and the visualizer is accompanied by an edit button, allowing the string value to be edited either in the preview or in the String Value Editor, shown below:

字串視覺效果

小型字串:Small Strings:

小型字串視覺效果]]

中等長度字串:Medium-length Strings:

中度字串視覺效果

編輯器:Editor:

編輯器視覺效果

IEnumerableIEnumerable

IEnumerable 會列舉所有值;透過按一下 [顯示值] 按鈕,即可檢視每個 IEnumerable 的值。IEnumerable enumerates all values; the values of each can be viewed by clicking the Show Values button. IEnumerable 選項不會顯示物件 (例如 ArrayArrayListList<>Dictionary<,>) 的值,因為它們具有自己的偵錯工具視覺化檢視。The IEnumerable option will not display values for objects such as Array, ArrayList, List<>, Dictionary<,> as these have their own debugger visualizers.

IEnumerable 視覺效果

其他視覺化檢視Other Visualizers

也有自己的內嵌視覺化檢視的其他某些類型如下:Some other types that also have their own inline visualizers are listed below:

其他視覺效果

  • 基本Primitives
    • 這會顯示基本類型的原始值。This will show the raw value of the primitive type.
  • 枚舉Enum
    • 這會顯示不含 enum 類型限定詞的欄位值。This will display the field value without the enum Type qualifier.
  • Tuple
    • 以格式 (,) 顯示Displayed in the format (,)
  • NullNull
    • 顯示 "null" 值。Shows "null" value.
  • URLURL
    • 這會顯示可按式超連結。This will display a clickable hyperlink.
  • IntPtrIntPtr
    • 這會顯示 IntPtr 的十六進位表示法。This will display a hexadecimal representation of the IntPtr.

請參閱See also