<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Catch the Dot</title><subtitle type="html" /><id>http://weblogs.asp.net/pawanmishra/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/pawanmishra/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2009-12-13T00:58:05Z</updated><entry><title>Algorithms Cheat Sheet : Graph Search</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2013/02/02/algorithms-cheat-sheet-graph-search.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2013/02/02/algorithms-cheat-sheet-graph-search.aspx</id><published>2013-02-02T09:10:35Z</published><updated>2013-02-02T09:10:35Z</updated><content type="html">Note : Below mentioned source code is taken from the book “Algorithm 4th Edition” by Robert Sedgewick. These code snippets are for personal reference. For more details on these topics you can either buy the book or refer the following site : http://algs4.cs.princeton.edu/home/ Topics Covered Graph data type Depth First Search Breadth First Search Symbol Graph Cycle Detection Two Colourable public interface IGraph { int NumberOfVertices{get;set;} int NumberOfEdges {get;set;} void AddEdge( int s, int...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2013/02/02/algorithms-cheat-sheet-graph-search.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9827891" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Algorithms" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Algorithms/default.aspx" /><category term="Graphs" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Graphs/default.aspx" /><category term="BFS" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/BFS/default.aspx" /><category term="DFS" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/DFS/default.aspx" /></entry><entry><title>Using jsPerf for performance tuning of JavaScript Code</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2012/11/04/using-jsperf-for-performance-tuing-of-javascript-code.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2012/11/04/using-jsperf-for-performance-tuing-of-javascript-code.aspx</id><published>2012-11-04T06:43:00Z</published><updated>2012-11-04T06:43:00Z</updated><content type="html">jsPerf is an online utility for evaluating the performance of your JavaScript code. You can submit multiple variations of your code and then evaluate their relative performance using jsPerf . Interesting feature about jsPerf is that it provides you the result in a browser specific manner i.e. you can run the test on multiple browsers and then compare the performance of your code on different browsers. In this article I will provide you a walkthrough on how to use jsPerf. Task : Compare the performance...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2012/11/04/using-jsperf-for-performance-tuing-of-javascript-code.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9295733" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="knockout.js" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/knockout.js/default.aspx" /><category term="Performance" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Performance/default.aspx" /><category term="javascript" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/javascript/default.aspx" /><category term="jsPerf" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/jsPerf/default.aspx" /></entry><entry><title>Getting Started With Knockout.js</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2012/10/28/getting-started-with-knockout-js.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2012/10/28/getting-started-with-knockout-js.aspx</id><published>2012-10-28T08:55:00Z</published><updated>2012-10-28T08:55:00Z</updated><content type="html">Client side template binding in web applications is getting popular with every passing day. More and more libraries are coming up with enhanced support for client side binding. jQuery templates is one very popular mechanism for client side template bindings. The idea with client side template binding is simple. Define the html mark-up with appropriate place holder for data. User template engines like jQuery template to bind the data(JSON formatted data) with the previously defined mark-up.In this...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2012/10/28/getting-started-with-knockout-js.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9236878" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="jQuery" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/jQuery/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="VS 2012" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/VS+2012/default.aspx" /><category term="MVC 4" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/MVC+4/default.aspx" /><category term="knockout.js" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/knockout.js/default.aspx" /><category term="Asp.Net MVC" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Asp.Net+MVC/default.aspx" /><category term="OData Services" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/OData+Services/default.aspx" /></entry><entry><title>Benefits of Following</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2012/10/27/benefits-of-following.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2012/10/27/benefits-of-following.aspx</id><published>2012-10-27T14:46:54Z</published><updated>2012-10-27T14:46:54Z</updated><content type="html">Things change pretty rapidly in technology world. New frameworks are coming up , existing ones are getting upgraded, languages are adding new features etc. And among all this, the important question for a developer like me or you is, how to keep our self updated? Although there are lots of things that can be done to keep our self updated, one of the approach that I have found working for me is to follow .Net programmers on Twitter. If you are reading this blog and you are on twitter, then all you...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2012/10/27/benefits-of-following.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9229717" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="twitter" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/twitter/default.aspx" /></entry><entry><title>Inauguration Of My Laptop</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2012/06/10/inauguration-of-my-laptop.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2012/06/10/inauguration-of-my-laptop.aspx</id><published>2012-06-09T19:56:00Z</published><updated>2012-06-09T19:56:00Z</updated><content type="html">Today I received my new laptop which is an Intel Core i5-2450M @ 2.50GHz 4 GB RAM machine . The other laptop(office provided) which I have used for past two years for programming is an Intel Core2 Duo T6570 @ 2.10GHz machine. Reason why I am talking about the laptops that I own is because of my interest in writing multi-threaded/parallel code using the new TPL API provided in the .Net 4.0 framework. I have spent significant amount of time in past one year writing code using the Parallel API of .Net...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2012/06/10/inauguration-of-my-laptop.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8590237" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Parallel.ForeEach" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Parallel.ForeEach/default.aspx" /><category term="Parallel.For" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Parallel.For/default.aspx" /><category term="Thread Local Storage" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Thread+Local+Storage/default.aspx" /><category term="Pattern Matching" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Pattern+Matching/default.aspx" /><category term="Threading" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Threading/default.aspx" /></entry><entry><title>Upcoming Courses on Coursera</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2012/05/21/upcoming-courses-on-coursera.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2012/05/21/upcoming-courses-on-coursera.aspx</id><published>2012-05-21T03:14:44Z</published><updated>2012-05-21T03:14:44Z</updated><content type="html">Coursera is offering free online courses on various topics such as Network, Information, HealthCare, Computer Science, Mathematics etc. Courses are grouped under these categories and they cover a wide range of topics. I recently completed a five week course called “Design and Analysis Of Algorithms” by Tim Roughgarden. Course material is good, video lectures are short, clear and downloadable. Programming exercise, Q&amp;amp;A, discussion forums etc are few other things that make these courses really...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2012/05/21/upcoming-courses-on-coursera.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8511445" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="Data Structure" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Data+Structure/default.aspx" /><category term="Coursera" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Coursera/default.aspx" /><category term="Algorithms" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Algorithms/default.aspx" /></entry><entry><title>Understanding Thread Local Storage(TLS) in TPL</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2012/05/16/understanding-thread-local-storage-tls-in-tpl.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2012/05/16/understanding-thread-local-storage-tls-in-tpl.aspx</id><published>2012-05-16T04:11:00Z</published><updated>2012-05-16T04:11:00Z</updated><content type="html">.Net 4.0 simplified writing parallel code by introducing the parallel variant of For/ForEach loop constructs. Most often the code that we write using Parallel.For/ForEach looks something like this : Parallel.ForEach(&amp;lt;some collection&amp;gt;,(item) =&amp;gt; { // do some work corresponding to each item and // store the result set in a common collection }); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff;...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2012/05/16/understanding-thread-local-storage-tls-in-tpl.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8503891" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term=".Net Framework 4.0" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/.Net+Framework+4.0/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Parallel.ForeEach" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Parallel.ForeEach/default.aspx" /><category term="Parallel.For" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Parallel.For/default.aspx" /><category term="locking" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/locking/default.aspx" /><category term="Thread Local Storage" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Thread+Local+Storage/default.aspx" /><category term="dotTrace" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/dotTrace/default.aspx" /></entry><entry><title>Generic Delegate Types : Func,Action and Predicate</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2010/11/21/generic-delegate-types-func-action-and-predicate.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2010/11/21/generic-delegate-types-func-action-and-predicate.aspx</id><published>2010-11-21T13:30:51Z</published><updated>2010-11-21T13:30:51Z</updated><content type="html">C# language has observed dramatic transformation from 2.0 to 3.0 and finally with 4.0. C# 2.0 added generics , simplified delegate syntax, nullable types etc. C# 3.0 takes it a level next by adding LINQ , anonymous methods , anonymous types etc and finally C# 4.0 add dynamism, enhances parallel programming by introducing Task Parallel Library. Of all these changes , some are altogether new functionalities in language , some enhance previous features by adding additional capabilities or by just simplifying...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2010/11/21/generic-delegate-types-func-action-and-predicate.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7648337" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Collection Classes" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Collection+Classes/default.aspx" /><category term="Delegates" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Delegates/default.aspx" /></entry><entry><title>Understanding “Dispatcher” in WPF</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2010/06/06/understanding-dispatcher-in-wpf.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2010/06/06/understanding-dispatcher-in-wpf.aspx</id><published>2010-06-06T07:38:59Z</published><updated>2010-06-06T07:38:59Z</updated><content type="html">Level : Beginner to intermediate Consider the following program MainWindow.xaml 1: &amp;lt; Window x:Class =&amp;quot;DispatcherTrial.MainWindow&amp;quot; 2: xmlns =&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot; 3: xmlns:x =&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot; 4: Title =&amp;quot;MainWindow&amp;quot; Height =&amp;quot;350&amp;quot; Width =&amp;quot;525&amp;quot; &amp;gt; 5: &amp;lt; Grid &amp;gt; 6: &amp;lt; Grid.RowDefinitions &amp;gt; 7: &amp;lt; RowDefinition /&amp;gt; 8: &amp;lt; RowDefinition /&amp;gt; 9: &amp;lt;/ Grid.RowDefinitions...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2010/06/06/understanding-dispatcher-in-wpf.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7519044" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="Design Patterns" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Design+Patterns/default.aspx" /><category term="WPF" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/WPF/default.aspx" /><category term="Dispatcher" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Dispatcher/default.aspx" /></entry><entry><title>Using IComparable&lt;T&gt; Interface</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2010/04/11/using-icomparable-lt-t-gt-interface.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2010/04/11/using-icomparable-lt-t-gt-interface.aspx</id><published>2010-04-11T16:07:29Z</published><updated>2010-04-11T16:07:29Z</updated><content type="html">Level : Beginner to Intermediate C# language has constantly evolved over a constant period of time.Each new version introduced new features which changed the way we programmed and solved the problems. Whether it was introduction of generics in C# 2.0 , LINQ in C# 3.0 or concept of dynamic programming in C# 4.0 , each of them had or will have greater impact on our programming style.As a developer we don’t have much option but to evolve and redefine our self in this constantly changing environment...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2010/04/11/using-icomparable-lt-t-gt-interface.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7439719" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Collection Classes" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Collection+Classes/default.aspx" /><category term=".Net Framework" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/.Net+Framework/default.aspx" /><category term="Design Patterns" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Design+Patterns/default.aspx" /></entry><entry><title>Collections in .Net</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2010/01/14/collections-in-net.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2010/01/14/collections-in-net.aspx</id><published>2010-01-14T09:47:50Z</published><updated>2010-01-14T09:47:50Z</updated><content type="html">Undoubtedly anyone who has ever programmed with any computer programming language has one way or the other has used some data structure , class etc to collect similar kind of data in one place.For example in C/C++ in order to handle multiple data of similar kind we have used Arrays. As programming languages evolved they also brought in various options of doing the same in more effective manner by offering developers with more number of data structures.In .Net framework these data structure are collectively...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2010/01/14/collections-in-net.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7310465" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Collection Classes" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Collection+Classes/default.aspx" /><category term=".Net Framework" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/.Net+Framework/default.aspx" /></entry><entry><title>Covariance and Contra-Variance in Delegates</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2010/01/14/covariance-and-contra-variance-in-delegates.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2010/01/14/covariance-and-contra-variance-in-delegates.aspx</id><published>2010-01-14T07:22:21Z</published><updated>2010-01-14T07:22:21Z</updated><content type="html">If it comes to day to day normal programming with C# language then delegates by far are the most complicated thing to understand.Delegates add the asynchronous programming model to .Net Framework.Working with delegates involve following steps : Declare a delegate type Create an instance of declared delegate type While creating an instance of delegate type , pass the method which needs to be invoked So following is one sample delegate type declaration internal delegate void DelegateDemo(string name...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2010/01/14/covariance-and-contra-variance-in-delegates.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7310354" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Delegates" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Delegates/default.aspx" /></entry><entry><title>Wintellect’s Power Collection Library</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2010/01/02/wintellect-s-power-collection-library.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2010/01/02/wintellect-s-power-collection-library.aspx</id><published>2010-01-01T20:03:06Z</published><updated>2010-01-01T20:03:06Z</updated><content type="html">First of all a very happy and prosperous new year wishes to everyone ……… :) CLR via C# by Jeffery Richter is one book which I really enjoyed reading.Any .Net developer whether experienced or a beginner will immediately benefit from the content provided in this book and will also help him/her to refine its overall programming with C# language. The book covers all major topics of C# programming language and explains them through the point of view of CLR i.e. how CLR interprets our code which we write...(&lt;a href="http://weblogs.asp.net/pawanmishra/archive/2010/01/02/wintellect-s-power-collection-library.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7297285" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="VS 2010 Beta 2" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/VS+2010+Beta+2/default.aspx" /><category term="Power Collection Library" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Power+Collection+Library/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/C_2300_/default.aspx" /><category term="Collection Classes" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Collection+Classes/default.aspx" /></entry><entry><title>Another VS 2010 feature : Pin-Up</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2009/12/26/another-vs-2010-feature-pin-up.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2009/12/26/another-vs-2010-feature-pin-up.aspx</id><published>2009-12-26T18:20:33Z</published><updated>2009-12-26T18:20:33Z</updated><content type="html">&lt;p&gt;Hello,&lt;/p&gt;  &lt;p&gt;I have been using &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;VS 2010 Beta 2&lt;/a&gt;&amp;#160;&lt;/a&gt; for sometime and today I came across another beautiful feature.Now , I don't know in technical terms what to call this feature, so its that I rather explain it with few pictures.&lt;/p&gt;  &lt;p&gt;Following is a very small piece of code I wrote as reply to one of the answer in &lt;a href="http://msdn.microsoft.com/en-us/default.aspx" target="_blank"&gt;MSDN&lt;/a&gt; forum :&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Forum&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Program&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str = &lt;span style="color: #006080"&gt;&amp;quot;Pawan Mishra&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; str2 = String.Intern(str);&lt;br /&gt;            str2 = &lt;span style="color: #006080"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;;&lt;br /&gt;            Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;{0} : {1}&amp;quot;&lt;/span&gt;, str, str2);&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Next what I did was I placed a break point in my code somewhere , so that compiler breaks at that point and I can actually see the values of the variables.&lt;/p&gt;

&lt;p&gt;So while debugging , we hover our mouse over the variable name and then in visualizer we can check the value of the variable.And as soon as the mouse cursor is moved the visualizer also disappears.This is where &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;VS 2010&lt;/a&gt; is getting different.&lt;/p&gt;

&lt;p&gt;In VS 2010 once you have hovered the mouse cursor over a variable name , you get option like to pin that visualizer.Didn’t get , its all right , just check the following screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_28E797EE.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_0CF662F6.png" width="320" height="120" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;As soon as you click on the pin icon , the variable and its corresponding value will be pinned just in front of the statement.Its shown in the following screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_2E928BC7.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_3A47D2F9.png" width="438" height="165" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now as you can see , the variable and its corresponding value is fixed.Also you can add comments for your future reference.You can also drag and drop this pin up thing(please forgive me as I don't know what else to call it ) across the screen.&lt;/p&gt;

&lt;p&gt;Other interesting aspect is if the pinned up variable value is changed somewhere down the line , the original value will also be refreshed automatically.&lt;/p&gt;

&lt;p&gt;Now If you have looked closely then I have encircled another small pin icon.On click of it the corresponding variable becomes editable and you can change its value.This changed value will be reflected in the subsequent lines.Following screenshot explains the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_0B71F48A.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_57B9625E.png" width="461" height="165" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Finally , these pinned up values will be retained even when the application is stopped.And once you hover over the corresponding variable , it will highlight the value retained from last debug.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_0E470DA3.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_1270E568.png" width="608" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Well , I guess this feature is really cool and will definitely ease out debugging effort.The only question remains unanswered about this feature is what exactly is it called ? &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7291841" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author></entry><entry><title>Mole : Visual Studio Visualizer</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/pawanmishra/archive/2009/12/13/mole-visual-studio-visualizer.aspx" /><id>http://weblogs.asp.net/pawanmishra/archive/2009/12/13/mole-visual-studio-visualizer.aspx</id><published>2009-12-12T19:58:05Z</published><updated>2009-12-12T19:58:05Z</updated><content type="html">&lt;p&gt;Visualizer’s are of great help when debugging your application.Visualizer’s essentially provide a the complete view of the data in separate modal dialogue window.I guess almost all of us have worked with DataSet’s and in order to see the data contained inside the DataSet , we hover our mouse cursor over the dataset variable and then select the magnifying glass.This in turn opens up a separate window , showing the content of DataSet.Visual Studio debugger comes with visualizer’s for plain text , HTML , XML based data , DataSet and its corresponding dependents.If you haven’t understood what visualizer’s are actually , then refer to the following screenshot.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/SampleVisualizer_14163003.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SampleVisualizer" border="0" alt="SampleVisualizer" src="http://weblogs.asp.net/blogs/pawanmishra/SampleVisualizer_thumb_5F1904F8.jpg" width="259" height="157" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the above screenshot , once the magnifying glass corresponding to “LastName” property is clicked , the actual value will be displayed in a separate window.This separate popup window is actually known as a Visualizer in Visual Studio.If you are interested in learning more about Visualizer’s the check out the following blog :- &lt;a href="http://geekswithblogs.net/technetbytes/archive/2008/06/11/122792.aspx"&gt;Custom Visual Studio Visualizer&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;I came to know about MOLE while reading an article in the blog &lt;a href="http://drwpf.com/blog/" target="_blank"&gt;Dr. WPF&lt;/a&gt;.Mole is also a visualizer built for Visual Studio.The team who have developed Mole have already published an excellent article on CodeProject.You can check out that article from following link :- &lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole For Visual Studio - With Editing - Visualize All Project Types&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Essentially Mole was targeted towards helping developers who where working on WPF.many of the feature's in Mole Visualizer like Logical Tree , Visual Tree etc helped the WPF developer’s in understanding the overall structure of elements in the application and also Mole helped them in viewing and understanding the corresponding XAML mark-up.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt; has still a lot to offer to those people who are not working on WPF.And to know that lets start first by getting Mole visualizer into our Visual Studio.You can download the Mole visualizer dll from the download link provided at the CodeProject site by the team of &lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt;.Once downloaded copy and paste the Mole.Visualizer.dll at anyone of the following locations :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;%Start\Documents\Visual Studio 2008\Visualizers\ &lt;/li&gt;    &lt;li&gt;%Root%\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers\ &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt; helps in visualizing following three things:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Current state of any custom object &lt;/li&gt;    &lt;li&gt;Current State of any Collection in the code &lt;/li&gt;    &lt;li&gt;Current state of any collection which is in turn inside some custom object &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Lets take up each of the above mentioned points one by one.Before that , I will provide one small sample code which will help in explaining the usage of &lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt; even more clearly.Here’s the code :&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Wintellect.PowerCollections;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; MoleVisualizerText&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Program&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;        {&lt;br /&gt;            Person adam = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Person(&lt;span style="color: #006080"&gt;&amp;quot;Adam&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Smith&amp;quot;&lt;/span&gt;, 23);&lt;br /&gt;            Person mark = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Person(&lt;span style="color: #006080"&gt;&amp;quot;Mark&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Ion&amp;quot;&lt;/span&gt;, 29);&lt;br /&gt;&lt;br /&gt;            List&amp;lt;Location&amp;gt; adamLocation = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;Location&amp;gt;();&lt;br /&gt;            adamLocation.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(&lt;span style="color: #006080"&gt;&amp;quot;London&amp;quot;&lt;/span&gt;, 2, LocationInterest.Yes));&lt;br /&gt;            adamLocation.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(&lt;span style="color: #006080"&gt;&amp;quot;Tokyo&amp;quot;&lt;/span&gt;,3,LocationInterest.Yes));&lt;br /&gt;            adamLocation.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(&lt;span style="color: #006080"&gt;&amp;quot;Manila&amp;quot;&lt;/span&gt;,1,LocationInterest.No));            &lt;br /&gt;            adam.Location = adamLocation;&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(adam);&lt;br /&gt;            Console.WriteLine(mark);&lt;br /&gt;&lt;br /&gt;            Console.ReadLine();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Person&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; LastName { get; set; }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Age { get; set; }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; List&amp;lt;Location&amp;gt; Location { get; set; }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Person(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; FirstName, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; LastName, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Age)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.FirstName = FirstName;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.LastName = LastName;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Age = Age;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ToString()&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; FirstName + &lt;span style="color: #006080"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + LastName + &lt;span style="color: #006080"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + Age;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Location&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; LocationName { get; set; }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; NumberOfYears { get; set; }&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; LocationInterest Interest { get; set; }&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Location(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Location, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; TimeSpent, LocationInterest interest)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.LocationName = Location;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.NumberOfYears = TimeSpent;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Interest = interest;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;enum&lt;/span&gt; LocationInterest&lt;br /&gt;    {&lt;br /&gt;        Yes,&lt;br /&gt;        No&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Following are the key points of above mentioned code &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Person class used to represent a given Person. &lt;/li&gt;

  &lt;li&gt;Person class contain fields like FirstName , LastName , Age to hold the respective value’s. &lt;/li&gt;

  &lt;li&gt;Also Person Class contain property called “Location” which is a collection of type “Location”. &lt;/li&gt;

  &lt;li&gt;Type “Location” is used to represent the various location wherein a given person has stayed , for how many years he/she stayed there and finally did he/she really enjoyed staying there or not.In order to represent the last point I have used an Enum called “LocationInterest”. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Current state of any custom object&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In order to view the current state of a particular object in your code in Mole , you will first have to put a break point on any line of your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_6342DCBD.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_071B8E4B.png" width="673" height="74" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Once that's done , then run the application and wait for the breakpoint to be hit.At that moment open the watch window and add the following expression in watch window : new &lt;a href="http://msdn.microsoft.com/en-us/library/system.weakreference.aspx" target="_blank"&gt;WeakReference&lt;/a&gt;(&amp;lt;name of the custom object&amp;gt;).In my case I have created an instance of Type “Person” and named it as “adam”.So the expression in watch window becomes new &lt;a href="http://msdn.microsoft.com/en-us/library/system.weakreference.aspx" target="_blank"&gt;WeakReference&lt;/a&gt;(adam).Following screenshot will explain it more clearly.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_44C87607.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_1B04FB14.png" width="884" height="105" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So with the above declaration , I have attached a watch expression on “adam” which is an instance of type “Person”.Finally click on the magnifying glass to open the &lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt; visualizer.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_4A7369E0.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_5C3FD7E0.png" width="644" height="293" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Mole visaulizer has got lots of options and covering them in this article is not possible.Fore more detailed explanation you can check out the article on &lt;a href="http://www.codeproject.com/" target="_blank"&gt;CodeProject&lt;/a&gt; site from the team of Mole.In the above diagram , we can see the current state of “adam” instance.It clearly explains that the properties like FirstName , LastName , Age have been set but the last property i.e. Location is null and has still not been initialized.&lt;/p&gt;

&lt;p&gt;If you think this is just normal , then here is the sweetest part.Mole actually remembers the instances which has been added in the watch expression , even in case of application restarts.So once you have added “adam” in watch window , you can view its state at any point of time while debugging the application.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Current State of any Collection in the code&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Similar to viewing custom objects , you can also view collections (List , Dictionary etc) in &lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt;.And the way to do is almost same as that of custom objects which is explained in the above segment.In the above mentioned code , I have defined “adamLocation” as a collection of type “Location” to hold the details of location adam has visited.So I will attach adamLocation in watch window.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_1B2132AF.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_2D898364.png" width="688" height="29" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Once done , click on the magnifying glass to open the Mole visualizer to view the various items in the adamLocation collection.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_2525AE0D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_3CCCBFA6.png" width="776" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Since I have added details about three locations , I can see three entries like [001],[002],[003] in the visualizer.To see the exact details , click on anyone of the hyperlinks of Value field.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_79350E83.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_76ABDCC5.png" width="488" height="192" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Since I clicked on item number [001] , I can see the corresponding details.So with &lt;a href="http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx" target="_blank"&gt;Mole&lt;/a&gt; , viewing the details of your collection is so easy.&lt;/p&gt;

&lt;p&gt;Well but that's not all.If viewing of details is concerned , then the next view provided by Mole will really take you by surprise.Lets see …..&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Current state of any collection which is in turn inside some custom object&lt;/strong&gt; &lt;/u&gt;&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;Person adam = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Person(&lt;span style="color: #006080"&gt;&amp;quot;Adam&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Smith&amp;quot;&lt;/span&gt;, 23);&lt;br /&gt;&lt;br /&gt;List&amp;lt;Location&amp;gt; adamLocation = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;Location&amp;gt;();&lt;br /&gt;adamLocation.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(&lt;span style="color: #006080"&gt;&amp;quot;London&amp;quot;&lt;/span&gt;, 2, LocationInterest.Yes));&lt;br /&gt;adamLocation.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(&lt;span style="color: #006080"&gt;&amp;quot;Tokyo&amp;quot;&lt;/span&gt;,3,LocationInterest.Yes));&lt;br /&gt;adamLocation.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(&lt;span style="color: #006080"&gt;&amp;quot;Manila&amp;quot;&lt;/span&gt;,1,LocationInterest.No));            &lt;br /&gt;adam.Location = adamLocation;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;In the above code,I have created an instance of type “Person” and named it as “adam”.Then a collection of type “Location” and in last line I assigned that collection variable to the Location property of “adam” instance.Finally “adam” instance has some static information and a collection of locations where he has stayed.&lt;/p&gt;

&lt;p&gt;Following the same way as we did in previous two steps , put a breakpoint , add the “adam” instance in watch window and once the breakpoint is hit , click the magnifying glass corresponding to the “adam” instance in watch window.Following is the screen shot of the Mole visualizer.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_7B41E77F.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_23FD4CC9.png" width="493" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The view looks pretty ordinary.Here click on the “Collection” hyperlink .Once clicked view changes to the following :-&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_01590E4E.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_259DF2D0.png" width="490" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Interesting thing to note here is that the “View Data” button is now enabled.Click on the button to open a new popup window , which displays the details of the Location collection in a nice , tabular manner.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pawanmishra/image_62DEA797.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pawanmishra/image_thumb_79BD7913.png" width="353" height="182" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I think this is the biggest advantage of Mole i.e. showing the details of collection in a nice , readable manner that too with very few minimal clicks.&lt;/p&gt;

&lt;p&gt;Mole is quiet a big enough to be covered in a single article.And I also say that the coverage of Mole has already been done in an excellent manner in the official article by the team of Mole.I wrote this article to highlight one of the feature of Mole which I really liked and I guess everyone else will like it too.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7277434" width="1" height="1"&gt;</content><author><name>Pawan_Mishra</name><uri>http://weblogs.asp.net/members/Pawan_5F00_Mishra.aspx</uri></author><category term="Mole" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/Mole/default.aspx" /><category term="VS 2008" scheme="http://weblogs.asp.net/pawanmishra/archive/tags/VS+2008/default.aspx" /></entry></feed>