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))]
///////////////////////////////////////////////////////////////////
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))]
///////////////////////////////////////////////////////////////////