How to create custom adorner add-in for numeric arrays in Visual Studio 2010?

I work with a lot of floating point images, and it would be very helpful to have a view based on the images of my arrays. I would like to create a WPF UserControl that displays an array of data (as shown below) as an image instead of a scrollable list of text values.

Is it possible? I reviewed the MDSN documentation on extensibility VS 2010, the SO list of VS 2010 extensions , and in this topic about creating a custom editor, but I lost a little where to start.

alt text

Update 1:

Thanks to Brian and Basarat Ali for their leadership on DebuggerVisualizer. It looks like the right strategy, EXCEPT that, unfortunately, the visualizer is forbidden for any types of arrays.

A crawl (limited utility) is a visualization of a wrapper object.

In Brian's suggestion, I posted a solution on CodePlex:

VS2010 Visualizers Contrib Debugger ( http://debuggervisualizers.codeplex.com/ ).

The project source code demonstrates a working shell visualizer and a non-functional "raw" data visualizer for the 1D double [] array. Here is a screenshot of the test console:

alt text

If anyone has suggestions for dealing with this issue, please let me know!

In addition, any explanation of why System.Array cannot be rendered is welcome!

Update 2:

I just tried SO with the word DebuggerVisualizer and found this previously asked question . It looks like a user. Dean suggests using the Moth Bridge project using WeakReference . You do not see how this works in DebuggerVisualizer.

Update 3:

Josh Smith Project Mole just offered a very useful job (thanks to Josh!):

Note. You can use your ArrayWrapper approach without changing the source code to open the visualizer. You can enter it in the "Watch" window in VS:

new YourNamespace.ArrayWrapper (myArray);

Press the Enter key, after which you will see a magnifying glass icon in the Clock window next to this line of code. Click it to open your own visualizer.

+7
visual-studio-2010 data-visualization wpf add-in adorner
source share
2 answers

You should create a debugger visualizer. Here's a walkthrough: http://msdn.microsoft.com/en-us/library/ms164759.aspx . I believe that you want to see all the results in an external program. To do this, you can simply add the export option to the list for export as a csv file. However, if you still feel that you want a bitmap, you can convert the list to an image using RenderTargetBitmap: http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx

+2
source share

Since this is for runtime information in the debugger, you might consider DebuggerVisualizer , rather than an editor extension. There are some tradeoffs, I don’t understand what would be better for this.

(In any case, I think it is possible, and it looks useful, and I hope someone with an extra weekend breaks it and sends the source code.)

0
source share

All Articles