3

I am developing XNA stuff and using their Matrix structure. When debugging, the value shown for a Matrix is something like:

enter image description here

which is not super convenient to read. I would like to have something like:

{ R:{ 0; 0; 0 } S:{ 1; 1; 1 } T:{ 0; 0; 0 } }

Since this structure is not mine I can not override the ToString method, nor the DebuggerDisplay attribute.

Is there a simple technic for this kind of feature? I imagine it as a common requirement. Maybe something to do with VisualStudio itself as a last resort?

Precision: I am not looking for the operation (Matrix.Decompose() for the curious), just the "rendering" of variables of this type in Visual Studio (or others after all) in debug mode.

Mr.Pe
  • 719
  • 1
  • 7
  • 19
  • 1
    You could write a [Visualizer](http://msdn.microsoft.com/en-us/library/zayyhzts.aspx), but it's a fair bit of work for (in this case) not much return. – Damien_The_Unbeliever Sep 21 '12 at 06:31
  • Yep, a bit of an overkill here. But good answer as a last resort. Thanks – Mr.Pe Sep 21 '12 at 07:17
  • 3
    This question is answered here: http://stackoverflow.com/questions/4469001/can-the-debuggerdisplay-attribute-be-applied-to-types-one-doesnt-own – Jason Shirk Feb 27 '14 at 02:27
  • Does this answer your question? [Can the DebuggerDisplay attribute be applied to types one doesn't own?](https://stackoverflow.com/questions/4469001/can-the-debuggerdisplay-attribute-be-applied-to-types-one-doesnt-own) – StayOnTarget Sep 23 '21 at 13:01

0 Answers0