Mahmoud ElMansy: knowledge meant to be free

Visual C# Code Snippets vs2012

This is the my first post on C# Code Snippet.
Code Snippets is a very handy feature inside Visual Studio there is of course defulat code snippets like,
“try,for,foreach,do,enum” i found them very helpful.

The cool thing is that you can create your Owen Snippet.
First : where to found visual studio snippet
“%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC#\Snippets\1033\Visual C#”

Second :  to manage Snippet inside visual studio you can do that from “Code Snippet Manager”



Now i will create my first Snippet for JQuery

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="">
  <CodeSnippet Format="1.0.0">
      <Code_ Language="javascript">
      <![CDATA[    $$(document).ready(function () {
                  // put all your jQuery goodness in here.

I will illustrate the XML
part 1) SnippetType :


How visual studio will write the snippet.
Part 2) Shortcut :


The shortcut to write to bring the snippet.

Part 3) Code Language=”” :

  <Code Language="javascript">

Here it is “javascript”.

Part 4) you code :

<![CDATA[ //Your Code.  ]]>