Debugger visualizer

U

Udi

Hi,
I have a simple example of a color visualizer and it works fine.


I've tried to add another (new) color visualizer
(an exact copy of the example) in a different (new) solution,
but for some reason I can't see my
new visualizer while debugging. (see code below)


Isn't it possible to add more than one visualizer
to the same type (Color)?


Why do I see only the visualizer from the example
(even when debugging the new solution), and can't
see my own visualizer which is part of that solution?
Thanks,
Udi.


///////////////////////////////////////////////////////////////////////////­///////////////////////////////////

MyColorVizualizer.cs
~~~~~~~~~~~~~~~~


public class MyColorVizualizer : DialogDebuggerVisualizer
{
protected override void Show(IDialogVisualizerService
windowService, IVisualizerObjectProvider objectProvider)
{
Debug.Assert(windowService != null);
Debug.Assert(objectProvider != null);


Color data = (Color)objectProvider.GetObject();


Debug.Assert(data != null);


using (MyColorVizualizerDlg displayForm =
new MyColorVizualizerDlg(data))
{
displayForm.Text += " " + data.ToString();
windowService.ShowDialog(displayForm);
}
}



}


//////////////////////////////////////////////////////////
MyColorVizualizerDlg.cs
~~~~~~~~~~~~~~~~~~

public partial class MyColorVizualizerDlg : Form
{
public MyColorVizualizerDlg(Color color)
{
InitializeComponent();
BackColor = color;
}
}


////////////////////////////////////////////////////////////////////
AssemblyInfo.cs
~~~~~~~~~~~~


[assembly: DebuggerVisualizer(typeof(MyColorVizualizer), Description =
"Udi's Color Visualizer", Target = typeof(Color))]


///////////////////////////////////////////////////////////////////
 
M

Miha Markic [MVP C#]

Hi Udi,

Isn't it possible to add more than one visualizer
to the same type (Color)?

Yes,


Why do I see only the visualizer from the example
(even when debugging the new solution), and can't
see my own visualizer which is part of that solution?

Did you copy your assembly to a suitable folder for visualizers?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top