<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://v900u039rux.maximumasp.com/Web/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Raheel Hussain : Visual Studio</title><link>http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/Visual+Studio/default.aspx</link><description>Tags: Visual Studio</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Code Snippets in Visual Studio.NET</title><link>http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/2007/10/11/code-snippets-in-visual-studio-net.aspx</link><pubDate>Thu, 11 Oct 2007 09:53:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:78</guid><dc:creator>Raheel Hussain</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/raheel/rsscomments.aspx?PostID=78</wfw:commentRss><comments>http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/2007/10/11/code-snippets-in-visual-studio-net.aspx#comments</comments><description>&lt;p&gt;Many times during our development, we face situations where we need to perform some basic tasks like reading/writing from file, sending email and etc.&amp;nbsp; &lt;br /&gt;Visual Studio.NET has these all present in the form of Code Snippets.&lt;/p&gt;
&lt;p&gt;Let us quickly explore that&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;What Code snippets are.&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;How they could be used.&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;How can we make our own code snipptes.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Code Snippets are basically managed blocks of code which you can import to your project,&amp;nbsp; and use them to increase your productivity and efficiency.&amp;nbsp; &lt;br /&gt;Visual Studio 2005 has a very nice set of code snippets of every language i.e. C# and Visual Basic.net etc.&lt;/p&gt;
&lt;p&gt;Basically they are nothing but XML files with [ .snippet ] extension. You can import these files ( except the by default ones which are already part of Visual Studio)&amp;nbsp; to be part of your code. Moreover, you can share your snippets with others as well as use Others&amp;#39;s snippets to your project.&lt;/p&gt;
&lt;p&gt;You can also go to &lt;a href="http://www.gotcodesnippets.com/"&gt;http://www.gotcodesnippets.com/&lt;/a&gt; web site to search for different code snippets of your choice. &lt;br /&gt;Or, at the end of this post, you may want to make your own code snippets .... &lt;/p&gt;
&lt;p&gt;You can download the Microsoft Code Snippet Editor for Visual Basic 2005 at &lt;a href="http://msdn2.microsoft.com/en-gb/vbasic/ms789085.aspx"&gt;http://msdn2.microsoft.com/en-gb/vbasic/ms789085.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To see the detailed list of snippets you can go to Tools Menu &amp;gt; Code Snippets Manager,&amp;nbsp; this will show you the list of snippets shipped for each language.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dnfug.com/Web/blogs/raheel/snippet_manager.GIF"&gt;&lt;img src="http://dnfug.com/Web/blogs/raheel/snippet_manager.GIF" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also, as the picture shows you that you can also search online for Code Snippets. An interesting thing will be to explore the structure of the snippet files. &lt;br /&gt;&lt;br /&gt;Lets do that ! &lt;/p&gt;
&lt;p&gt;Go to the Visual Studio.NET installation folder&amp;nbsp; typically &amp;quot; C:\Program Files\Microsoft Visual Studio 8 &amp;quot;&lt;/p&gt;
&lt;p&gt;Here you can find folders for VB, VC#,VJ# etc.&amp;nbsp; Double click on VB folder to go inside.... while there will be a folder called as &amp;quot;Snippets&amp;quot;&lt;/p&gt;
&lt;p&gt;The reason to tell you this way instead of writting the whole path is that you may require to go (may be C#)&amp;nbsp; to other languages folder except VB.&lt;/p&gt;
&lt;p&gt;The complete path to the snippets folder will be&amp;nbsp;&amp;nbsp;&amp;quot;C:\Program Files\Microsoft Visual Studio 8\VB\Snippets\1033\&amp;quot;&lt;/p&gt;
&lt;p&gt;While inside that folder you may find different folders which refer to different categories of the code blogs, i.e. for filesystem related code&amp;nbsp; snippets, I would go to &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;quot;D:\Program Files\Microsoft Visual Studio 8\VB\Snippets\1033\filesystem&amp;quot;&lt;/p&gt;
&lt;p&gt;Let me select an snippet file called as &amp;quot;GetInformationAboutaFile.snippet&amp;quot;. As the name refers, this file gets the information about a file into a fileinfo object. &lt;/p&gt;
&lt;p&gt;The file has different sections which are as follows.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style="BORDER-RIGHT:1px solid;BORDER-TOP:1px solid;OVERFLOW:scroll;BORDER-LEFT:1px solid;WIDTH:546px;BORDER-BOTTOM:1px solid;BACKGROUND-COLOR:#f5f5f5;"&gt;&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;
&amp;lt;CodeSnippets xmlns=&amp;quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&amp;quot;&amp;gt;
  &amp;lt;CodeSnippet Format=&amp;quot;1.0.0&amp;quot;&amp;gt;
    &amp;lt;Header&amp;gt;
      &amp;lt;Title&amp;gt;Get Information About a File &amp;lt;/Title&amp;gt;
      &amp;lt;Author&amp;gt;Microsoft Corporation&amp;lt;/Author&amp;gt;
      &amp;lt;Description&amp;gt;Obtains an object containing information about a file.&amp;lt;/Description&amp;gt;
      &amp;lt;Shortcut&amp;gt;filFileInfo&amp;lt;/Shortcut&amp;gt;
    &amp;lt;/Header&amp;gt;
    &amp;lt;Snippet&amp;gt;
      &amp;lt;Imports&amp;gt;
        &amp;lt;Import&amp;gt;
          &amp;lt;Namespace&amp;gt;System.IO&amp;lt;/Namespace&amp;gt;
        &amp;lt;/Import&amp;gt;
      &amp;lt;/Imports&amp;gt;
      &amp;lt;Declarations&amp;gt;
        &amp;lt;Literal&amp;gt;
          &amp;lt;ID&amp;gt;Filename&amp;lt;/ID&amp;gt;
          &amp;lt;Type&amp;gt;String&amp;lt;/Type&amp;gt;
          &amp;lt;ToolTip&amp;gt;Replace with the file name.&amp;lt;/ToolTip&amp;gt;
          &amp;lt;Default&amp;gt;&amp;quot;C:\Test.txt&amp;quot;&amp;lt;/Default&amp;gt;
        &amp;lt;/Literal&amp;gt;
      &amp;lt;/Declarations&amp;gt;
      &amp;lt;Code Language=&amp;quot;VB&amp;quot; Kind=&amp;quot;method body&amp;quot;&amp;gt;&amp;lt;![CDATA[Dim fileData As FileInfo = My.Computer.FileSystem.GetFileInfo($Filename$)]]&amp;gt;&amp;lt;/Code&amp;gt;
    &amp;lt;/Snippet&amp;gt;
  &amp;lt;/CodeSnippet&amp;gt;
&amp;lt;/CodeSnippets&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;In the above,&amp;nbsp; things to note are the Header section, where you can specify the title, author, description and the shortcut.&lt;/p&gt;
&lt;p&gt;The shortcut is nothing but a way to include the code snippet into your solution. There can be two ways to include the code snippet to your solution.&lt;/p&gt;
&lt;p&gt;1 - Right click in the code window and select &amp;quot;Insert Snippet&amp;quot; , and then follow the context menu options to select the appropriate snippet of your choice&lt;br /&gt;2 - Simply type the shortcut of any specific snippet in your code window and press TAB. This will automatically include the complete code snippet to your solution.&lt;br /&gt;&lt;br /&gt;Following diagragam shows the right click method of inserting the code snippet&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style="BORDER-RIGHT:1px solid;BORDER-TOP:1px solid;OVERFLOW:scroll;BORDER-LEFT:1px solid;WIDTH:546px;BORDER-BOTTOM:1px solid;BACKGROUND-COLOR:#f5f5f5;"&gt;&lt;a href="http://dnfug.com/Web/blogs/raheel/insert_snippet.GIF"&gt;&lt;img src="http://dnfug.com/Web/blogs/raheel/insert_snippet.GIF" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;With the&amp;nbsp; &amp;lt;Snippet&amp;gt; tag, the actuall snippet starts. This tag is followed by the &amp;lt;Imports&amp;gt; section which can include multiple include of namespaces required to that code &lt;br /&gt;snippet to work.&amp;nbsp; Second, comes the declaration section whereyou specify the Literals with their ID, Data Type , Tooltip and a Default value i.e. default value (if any). 
&lt;p&gt;Finally, comes the Code section, preceeded by Code tag with Language specification and etc.&amp;nbsp; The actual code is preceeded by &lt;br /&gt;&lt;br /&gt;&amp;lt;![CDATA[ &lt;br /&gt;.&lt;br /&gt;.&lt;br /&gt;.&lt;/p&gt;
&lt;p&gt;]]&lt;br /&gt;&lt;br /&gt;As you&amp;nbsp;saw in the snippet code that the variable we declared within the declaration Tag, is here with $Filename$. The $Filename$ is the Literal which (when snippet is included in code) will be replaced by its associated value in your solution.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style="BORDER-RIGHT:1px solid;BORDER-TOP:1px solid;OVERFLOW:scroll;BORDER-LEFT:1px solid;WIDTH:546px;BORDER-BOTTOM:1px solid;BACKGROUND-COLOR:#f5f5f5;"&gt;&amp;lt;&lt;a href="http://dnfug.com/Web/blogs/raheel/insert_snippet_inserted.GIF"&gt;&lt;img src="http://dnfug.com/Web/blogs/raheel/insert_snippet_inserted.GIF" border="0" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Moreover, code snippets not only can be used for vb.NET or c#.NET code but you can simply put your HTML code into it and can insert in an .html file or .aspx file.&lt;/p&gt;
&lt;p&gt;Happy coding !!!! &lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=78" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/Code+Snippets/default.aspx">Code Snippets</category></item><item><title>ListView - The new control in ASPNET3.5</title><link>http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/2007/08/15/listview-the-new-control-in-aspnet3-5.aspx</link><pubDate>Wed, 15 Aug 2007 11:17:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:56</guid><dc:creator>Raheel Hussain</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/raheel/rsscomments.aspx?PostID=56</wfw:commentRss><comments>http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/2007/08/15/listview-the-new-control-in-aspnet3-5.aspx#comments</comments><description>&lt;p&gt;&amp;lt;Asp:ListView&amp;gt; is the new control in town !&lt;br /&gt;&lt;br /&gt;ASP.NET 3.5 coming with this control&amp;nbsp;is probably the popular one. &lt;br /&gt;&lt;br /&gt;This supports paging, sorting, insertion, deletion, and all that is not there in the DataList&amp;nbsp;(since Asp.net 1.x, 2.0) &lt;/p&gt;
&lt;p&gt;and complete HTML markup control.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;When it comes to DataList, which doesnt support paging and sorting operations but support showing &lt;br /&gt;the rows over the columns (Horizontal manner), it is definetely a releif for developers.&lt;/p&gt;
&lt;p&gt;Stay tuned to &lt;a href="http://weblogs.asp.net/scottgu/"&gt;Scott Gu&amp;#39;s Blog&lt;/a&gt; as more posts are expected on it.&lt;/p&gt;
&lt;p&gt;cheers !&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=56" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/Data/default.aspx">Data</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/raheel/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>