Click here to Skip to main content
12,295,457 members (56,859 online)
Click here to Skip to main content

Stats

109.8K views
6 downloads
49 bookmarked
Posted

Mole II for WPF

, , , 31 Dec 2007 CPOL
Introduces the second version of a very useful and educational debugger visualizer for WPF developers.
Mole_Visualizer_2_1_1_VS2008_SourceAndTestProject.zip
Mole_Visualizer_2_1_1_VS2005_SourceAndTestProject.zip
Mole_Visualizer_2_1_1_VS2005_Release.zip
Mole_Visualizer_2_1_1_VS2008_Release.zip
Mole.Visualizer.dll
Mole.Visualizer
Custom Controls
Data Source
Image Processing
Data
Debugger Visualizer
Enums Constants
Event Args
Extended Controls
Images
MoleVisualUnavailable.gif
Mole.Visualizer.csi
Mole.Visualizer.suo
Mole.Visualizer.vbproj.user
My Project
Application.myapp
Settings
Visualizer UI
XSLT
Mole.TestBench
bach.jpg
Mole.TestBench.csi
Mole.TestBench.suo
My Project
Mole.Visualizer.dll
bach.jpg
Mole.TestBench.csi
Mole.TestBench.suo
MoleVisualUnavailable.gif
Mole.Visualizer.csi
Mole.Visualizer.suo
Mole.Visualizer.vbproj.user
Application.myapp
Mole.Visualizer.dll
MoleVisualUnavailable.gif
Mole.Visualizer.csi
Mole.Visualizer.suo
Mole.Visualizer.vbproj.user
Application.myapp
bach.jpg
Mole.TestBench.csi
Mole.TestBench.suo
Mole.Visualizer.dll
MoleVisualUnavailable.gif
Mole.Visualizer.csi
Mole.Visualizer.suo
Mole.Visualizer.vbproj.user
Application.myapp
bach.jpg
Mole.TestBench.csi
Mole.TestBench.suo
Mole.Visualizer.dll
MoleVisualUnavailable.gif
Mole.Visualizer.csi
Mole.Visualizer.suo
Mole.Visualizer.vbproj.user
Application.myapp
bach.jpg
Mole.TestBench.csi
Mole.TestBench.suo
Mole.Visualizer.dll
MoleVisualUnavailable.gif
Mole.Visualizer.csi
Mole.Visualizer.suo
Mole.Visualizer.vbproj.user
Application.myapp
bach.jpg
Mole.TestBench.csi
Mole.TestBench.suo
<!--
 |
 | XSLT REC Compliant Version of IE5 Default Stylesheet
 |
 | Original version by Jonathan Marsh (jmarsh@xxxxxxxxxxxxx)
 | http://msdn.microsoft.com/xml/samples/defaultss/defaultss.xsl
 |
 | Conversion to XSLT 1.0 REC Syntax by Steve Muench (smuench@xxxxxxxxxx)
 |
 +-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output indent="yes" method="html"/>

    <xsl:template match="/">
        <HTML>
            <HEAD>
                <SCRIPT>
                    <xsl:comment>
                        <![CDATA[
                  function f(e){
                     if (e.className=="ci") {
                       if (e.children(0).innerText.indexOf("\n")>0) fix(e,"cb");
                     }
                     if (e.className=="di") {
                       if (e.children(0).innerText.indexOf("\n")>0) fix(e,"db");
                     } e.id="";
                  }
                  function fix(e,cl){
                    e.className=cl;
                    e.style.display="block";
                    j=e.parentElement.children(0);
                    j.className="c";
                    k=j.children(0);
                    k.style.visibility="visible";
                    k.href="#";
                  }
                  function ch(e) {
                    mark=e.children(0).children(0);
                    if (mark.innerText=="+") {
                      mark.innerText="-";
                      for (var i=1;i<e.children.length;i++) {
                        e.children(i).style.display="block";
                      }
                    }
                    else if (mark.innerText=="-") {
                      mark.innerText="+";
                      for (var i=1;i<e.children.length;i++) {
                        e.children(i).style.display="none";
                      }
                    }
                  }
                  function ch2(e) {
                    mark=e.children(0).children(0);
                    contents=e.children(1);
                    if (mark.innerText=="+") {
                      mark.innerText="-";
                      if (contents.className=="db"||contents.className=="cb") {
                        contents.style.display="block";
                      }
                      else {
                        contents.style.display="inline";
                      }
                    }
                    else if (mark.innerText=="-") {
                      mark.innerText="+";
                      contents.style.display="none";
                    }
                  }
                  function cl() {
                    e=window.event.srcElement;
                    if (e.className!="c") {
                      e=e.parentElement;
                      if (e.className!="c") {
                        return;
                      }
                    }
                    e=e.parentElement;
                    if (e.className=="e") {
                      ch(e);
                    }
                    if (e.className=="k") {
                      ch2(e);
                    }
                  }
                  function ex(){}
                  function h(){window.status=" ";}
                  document.onclick=cl;
              ]]>
                    </xsl:comment>
                </SCRIPT>
                <STYLE>
                    BODY {font:x-small 'Courier New'; margin-right:1.5em}
                    .c  {cursor:hand}
                    .b  {color:red; font-family:'Courier New'; font-weight:bold; text-decoration:none}
                    .e  {margin-left:1em; text-indent:-1em; margin-right:1em}
                    .k  {margin-left:1em; text-indent:-1em; margin-right:1em}
                    .t  {color:#990000}
                    .xt {color:#990099}
                    .ns {color:red}
                    .dt {color:green}
                    .m  {color:blue}
                    .tx {font-weight:bold}
                    .db {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;padding-left:.3em; border-left:1px solid #CCCCCC; font:small Courier}
                    .di {font:small Courier}
                    .d  {color:blue}
                    .pi {color:blue}
                    .cb {text-indent:0px; margin-left:1em; margin-top:0px; margin-bottom:0px;padding-left:.3em; font:small Courier; color:#888888}
                    .ci {font:small Courier; color:#888888}
                    PRE {margin:0px; display:inline}
                </STYLE>
            </HEAD>
            <BODY class="st">
                <xsl:apply-templates/>
            </BODY>
        </HTML>
    </xsl:template>

    <xsl:template match="processing-instruction()">
        <DIV class="e">
            <SPAN class="b">
                <xsl:call-template name="entity-ref">
                    <xsl:with-param name="name">nbsp</xsl:with-param>
                </xsl:call-template>
            </SPAN>
            <SPAN class="m">
                <xsl:text>&lt;?</xsl:text>
            </SPAN>
            <SPAN class="pi">
                <xsl:value-of select="name(.)"/>
                <xsl:value-of select="."/>
            </SPAN>
            <SPAN class="m">
                <xsl:text>?></xsl:text>
            </SPAN>
        </DIV>
    </xsl:template>

    <xsl:template match="processing-instruction('xml')">
        <DIV class="e">
            <SPAN class="b">
                <xsl:call-template name="entity-ref">
                    <xsl:with-param name="name">nbsp</xsl:with-param>
                </xsl:call-template>
            </SPAN>
            <SPAN class="m">
                <xsl:text>&lt;?</xsl:text>
            </SPAN>
            <SPAN class="pi">
                <xsl:text>xml </xsl:text>
                <xsl:for-each select="@*">
                    <xsl:value-of select="name(.)"/>
                    <xsl:text>="</xsl:text>
                    <xsl:value-of select="."/>
                    <xsl:text>" </xsl:text>
                </xsl:for-each>
            </SPAN>
            <SPAN class="m">
                <xsl:text>?> </xsl:text>
            </SPAN>
        </DIV>
    </xsl:template>

    <xsl:template match="@*">
        <SPAN class="b">
            <xsl:call-template name="entity-ref">
                <xsl:with-param name="name">nbsp</xsl:with-param>
            </xsl:call-template>
        </SPAN>
        <SPAN>
            <xsl:attribute name="class">
                <xsl:if test="xsl:*/@*">
                    <xsl:text>x</xsl:text>
                </xsl:if>
                <xsl:text>t</xsl:text>
            </xsl:attribute>
            <xsl:value-of select="name(.)"/>
        </SPAN>
        <SPAN class="m">="</SPAN>
        <B>
            <xsl:value-of select="."/>
        </B>
        <SPAN class="m">"</SPAN>
    </xsl:template>

    <xsl:template match="text()">
        <DIV class="e">
            <SPAN class="b"> </SPAN>
            <SPAN class="tx">
                <xsl:value-of select="."/>
            </SPAN>
        </DIV>
    </xsl:template>

    <xsl:template match="comment()">
        <DIV class="k">
            <SPAN>
                <A STYLE="visibility:hidden" class="b" onclick="return false"
                   onfocus="h()">-</A>
                <SPAN class="m">
                    <xsl:text>&lt;!--</xsl:text>
                </SPAN>
            </SPAN>
            <SPAN class="ci" id="clean">
                <PRE>
                    <xsl:value-of select="."/>
                </PRE>
            </SPAN>
            <SPAN class="b">
                <xsl:call-template name="entity-ref">
                    <xsl:with-param name="name">nbsp</xsl:with-param>
                </xsl:call-template>
            </SPAN>
            <SPAN class="m">
                <xsl:text>--></xsl:text>
            </SPAN>
            <SCRIPT>f(clean);</SCRIPT>
        </DIV>
    </xsl:template>

    <xsl:template match="*">
        <DIV class="e">
            <DIV STYLE="margin-left:1em;text-indent:-2em">
                <SPAN class="b">
                    <xsl:call-template name="entity-ref">
                        <xsl:with-param name="name">nbsp</xsl:with-param>
                    </xsl:call-template>
                </SPAN>
                <SPAN class="m">&lt;</SPAN>
                <SPAN>
                    <xsl:attribute name="class">
                        <xsl:if test="xsl:*">
                            <xsl:text>x</xsl:text>
                        </xsl:if>
                        <xsl:text>t</xsl:text>
                    </xsl:attribute>
                    <xsl:value-of select="name(.)"/>
                    <xsl:if test="@*">
                        <xsl:text> </xsl:text>
                    </xsl:if>
                </SPAN>
                <xsl:apply-templates select="@*"/>
                <SPAN>
                    <xsl:text>/></xsl:text>
                </SPAN>
            </DIV>
        </DIV>
    </xsl:template>

    <xsl:template match="*[node()]">
        <DIV class="e">
            <DIV class="c">
                <A class="b" href="#" onclick="return false" onfocus="h()">-</A>
                <SPAN class="m">&lt;</SPAN>
                <SPAN>
                    <xsl:attribute name="class">
                        <xsl:if test="xsl:*">
                            <xsl:text>x</xsl:text>
                        </xsl:if>
                        <xsl:text>t</xsl:text>
                    </xsl:attribute>
                    <xsl:value-of select="name(.)"/>
                    <xsl:if test="@*">
                        <xsl:text> </xsl:text>
                    </xsl:if>
                </SPAN>
                <xsl:apply-templates select="@*"/>
                <SPAN>
                    <xsl:text>></xsl:text>
                </SPAN>
            </DIV>
            <DIV>
                <xsl:apply-templates/>
                <DIV>
                    <SPAN class="b">
                        <xsl:call-template name="entity-ref">
                            <xsl:with-param name="name">nbsp</xsl:with-param>
                        </xsl:call-template>
                    </SPAN>
                    <SPAN class="m">
                        <xsl:text>&lt;/</xsl:text>
                    </SPAN>
                    <SPAN>
                        <xsl:attribute name="class">
                            <xsl:if test="xsl:*">
                                <xsl:text>x</xsl:text>
                            </xsl:if>
                            <xsl:text>t</xsl:text>
                        </xsl:attribute>
                        <xsl:value-of select="name(.)"/>
                    </SPAN>
                    <SPAN>
                        <xsl:text>></xsl:text>
                    </SPAN>
                </DIV>
            </DIV>
        </DIV>
    </xsl:template>

    <xsl:template match="*[text() and not (comment() or processing-instruction())]">
        <DIV class="e">
            <DIV STYLE="margin-left:1em;text-indent:-2em">
                <SPAN class="b">
                    <xsl:call-template name="entity-ref">
                        <xsl:with-param name="name">nbsp</xsl:with-param>
                    </xsl:call-template>
                </SPAN>
                <SPAN class="m">
                    <xsl:text>&lt;</xsl:text>
                </SPAN>
                <SPAN>
                    <xsl:attribute name="class">
                        <xsl:if test="xsl:*">
                            <xsl:text>x</xsl:text>
                        </xsl:if>
                        <xsl:text>t</xsl:text>
                    </xsl:attribute>
                    <xsl:value-of select="name(.)"/>
                    <xsl:if test="@*">
                        <xsl:text> </xsl:text>
                    </xsl:if>
                </SPAN>
                <xsl:apply-templates select="@*"/>
                <SPAN>
                    <xsl:text>></xsl:text>
                </SPAN>
                <SPAN class="tx">
                    <xsl:value-of select="."/>
                </SPAN>
                <SPAN class="m">&lt;/</SPAN>
                <SPAN>
                    <xsl:attribute name="class">
                        <xsl:if test="xsl:*">
                            <xsl:text>x</xsl:text>
                        </xsl:if>
                        <xsl:text>t</xsl:text>
                    </xsl:attribute>
                    <xsl:value-of select="name(.)"/>
                </SPAN>
                <SPAN>
                    <xsl:text>> </xsl:text>
                </SPAN>
            </DIV>
        </DIV>
    </xsl:template>

    <xsl:template match="*[*]" priority="20">
        <DIV class="e">
            <DIV STYLE="margin-left:1em;text-indent:-2em" class="c">
                <A class="b" href="#" onclick="return false" onfocus="h()">-</A>
                <SPAN class="m">&lt;</SPAN>
                <SPAN>
                    <xsl:attribute name="class">
                        <xsl:if test="xsl:*">
                            <xsl:text>x</xsl:text>
                        </xsl:if>
                        <xsl:text>t</xsl:text>
                    </xsl:attribute>
                    <xsl:value-of select="name(.)"/>
                    <xsl:if test="@*">
                        <xsl:text> </xsl:text>
                    </xsl:if>
                </SPAN>
                <xsl:apply-templates select="@*"/>
                <SPAN>
                    <xsl:text>></xsl:text>
                </SPAN>
            </DIV>
            <DIV>
                <xsl:apply-templates/>
                <DIV>
                    <SPAN class="b">
                        <xsl:call-template name="entity-ref">
                            <xsl:with-param name="name">nbsp</xsl:with-param>
                        </xsl:call-template>
                    </SPAN>
                    <SPAN class="m">
                        <xsl:text>&lt;/</xsl:text>
                    </SPAN>
                    <SPAN>
                        <xsl:attribute name="class">
                            <xsl:if test="xsl:*">
                                <xsl:text>x</xsl:text>
                            </xsl:if>
                            <xsl:text>t</xsl:text>
                        </xsl:attribute>
                        <xsl:value-of select="name(.)"/>
                    </SPAN>
                    <SPAN>
                        <xsl:text>></xsl:text>
                    </SPAN>
                </DIV>
            </DIV>
        </DIV>
    </xsl:template>

    <xsl:template name="entity-ref">
        <xsl:param name="name"/>
        <xsl:text disable-output-escaping="yes">&amp;</xsl:text>
        <xsl:value-of select="$name"/>
        <xsl:text>;</xsl:text>
    </xsl:template>

</xsl:stylesheet>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Authors

Andrew Smith
Architect Infragistics, Inc.
United States United States
Andrew currently works as an architect for Infragistics working with windows forms and WPF. You can check out his blog here.

Josh Smith
Software Developer (Senior) Cynergy Systems
United States United States
Josh creates software, for iOS and Windows.

He works at Cynergy Systems as a Senior Experience Developer.

Read his iOS Programming for .NET Developers[^] book to learn how to write iPhone and iPad apps by leveraging your existing .NET skills.

Use his Master WPF[^] app on your iPhone to sharpen your WPF skills on the go.

Check out his Advanced MVVM[^] book.

Visit his WPF blog[^] or stop by his iOS blog[^].

Karl Shifflett
Architect
United States United States

Current passions are: Electron, ES6, Node.js, Angular, Aurelia, hybrid, Socket.IO, MQTT, and IoT.

Still keen on WPF and Prism, but currently Electron and ES6 deliver the same apps with much better performance, and they are cross-platform.

My Github Repros

Just a grain of sand on the worlds beaches.


You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160525.2 | Last Updated 31 Dec 2007
Article Copyright 2007 by Andrew Smith, Josh Smith, Karl Shifflett
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid