Debugger visualizer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Udi

    #1

    Debugger visualizer

    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.


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

    MyColorVizualiz er.cs
    ~~~~~~~~~~~~~~~ ~


    public class MyColorVizualiz er : DialogDebuggerV isualizer
    {
    protected override void Show(IDialogVis ualizerService
    windowService, IVisualizerObje ctProvider objectProvider)
    {
    Debug.Assert(wi ndowService != null);
    Debug.Assert(ob jectProvider != null);


    Color data = (Color)objectPr ovider.GetObjec t();


    Debug.Assert(da ta != null);


    using (MyColorVizuali zerDlg displayForm =
    new MyColorVizualiz erDlg(data))
    {
    displayForm.Tex t += " " + data.ToString() ;
    windowService.S howDialog(displ ayForm);
    }
    }



    }


    //////////////////////////////////////////////////////////
    MyColorVizualiz erDlg.cs
    ~~~~~~~~~~~~~~~ ~~~

    public partial class MyColorVizualiz erDlg : Form
    {
    public MyColorVizualiz erDlg(Color color)
    {
    InitializeCompo nent();
    BackColor = color;
    }
    }


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


    [assembly: DebuggerVisuali zer(typeof(MyCo lorVizualizer), Description =
    "Udi's Color Visualizer", Target = typeof(Color))]


    ///////////////////////////////////////////////////////////////////

  • Miha Markic [MVP C#]

    #2
    Re: Debugger visualizer

    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?

    --
    Miha Markic [MVP C#]
    RightHand .NET consulting & development www.rthand.com
    Blog: http://cs.rthand.com/blogs/blog_with_righthand/


    Comment

    Working...