Ever wondered how to write code snippet? Have a look at these simple example code snippets – these are specially for people who learn by looking!
You have to place these code snippets (basically XML) into file with .snippet extension. Then you can put all your snippet files into appropriate directory. This directory can be loaded into VS from Tools>Code Snippets Manager>Add. Enjoy!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| <?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://NewtonicaOnline.com/VS/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Copy Right - crc</Title>
<Description>Adds copyright comment</Description>
<Author>Chetan Panchal</Author>
<HelpUrl>http://www.NewtonicaOnline.com</HelpUrl>
<Shortcut >crc</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>Descr</ID>
<ToolTip>Replace with brief description of file content.</ToolTip>
<Default>Brief description</Default>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="any">
<![CDATA[// You can distribute or derive from this work without removing following lines.
// (C) Copyright 2008, Chetan Panchal, All rights reserved, http://www.NewtonicaOnline.com
// Description: $Descr$$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>Console.WriteLine Surrounds</Title>
<Description>Surrounds selection with Console.WriteLine</Description>
<Author>Chetan Panchal</Author>
<HelpUrl>http://www.NewtonicaOnline.com</HelpUrl>
<Shortcut >cws</Shortcut>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method body">
<![CDATA[$SystemConsole$.WriteLine($selected$$end$);]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>Console.ReadLine</Title>
<Description>Inserts Console.ReadLine()</Description>
<Author>Chetan Panchal</Author>
<HelpUrl>http://www.NewtonicaOnline.com</HelpUrl>
<Shortcut >cr</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="CSharp" Kind="method body">
<![CDATA[$SystemConsole$.ReadLine();$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets> |
Large monitor, or if possible – two of them!
Reasonably fast PC
(compiler, IDE, browser and db server etc to go fast)
As much RAM as possible
(PC should not slow down due to lack of RAM when RAM could be expanded)
Reasonably fast internet connection
(Not to watch movies, but to view self-learning videos etc)
Good keyboard and mouse
(Keys must not be stuck, standard KB design, working mouse clicking etc)
Great chair and table
Peaceful environment
Latest Development support tools
(IDEs, DBs, ORMs, Components, Libraries, etc)
Freedom to wear casuals
Freedom to have tea/coffee etc at table
Better Ajax (e.g. ClientID in webforms, clean HTML emission)
Better Entity Framework
Better WCF, WF and WPF (specially DataGrid in WPF)
Covariance and Contravariance
Code Contracts
Charting in ASP.Net
Dynamic Language Runtime and dynamic keyword in C#
Generate code element from usage
Improved Intellisense and Code navigation
Managed Extensibility Framework
Memory-mapped files
Multi-Monitor
MVC (Area and Asynch controller)
Named and optional argument in C#
Office programmability
One-click Deployment
Profiling, Debugging and IntelliTrace
Routing
Silverlight Capability
Text templates
Type equivalence
Visualization Tools
XSLT Profiling & Debugging and XSD Designer
Ctry+Y: Redo (reversing Ctrl+Z!)
F4: Repeate Last Command
F5, Ctrl+G: Open Go To Dialogbox
Ctrl+L/E/R/J: Align Left/Center/Right/Justify
Ctrl+B/I/U: Bold/Italics/Underline
Ctrl+F/H: Find/Replace
Doubleclick on word: Select word
Ctrl+Click: Select sentence
Triple Click: Select Paragraph
Click small arrow on bottom-right of group in ribbon: Open dialogbox
F7: Start spell checker
Ctrl+Arrow Keys: Jump words
Ctrl+Shift+Arrow Keys: Select words
Alt: See shortcuts on screen
Ctrl+F1: Show/Hide ribbon
Ctrl+F2: Show Print Preview
Ctrl+F6: Change window
Shift+F10: Customize Statusbar
Ctrl+Shift+Space: Non-breaking space
Ctrl+Hyphen: Non-breaking hyphen
Ctrl+[/]: Increase/Decrease font size by one point
Ctrl+Space: Remove formatting
Ctrl+Alt+V: Paste special
Ctrl+Delete: Delete word on right
Ctrl+Backspace: Delete work on left
Ctrl+Alt+Y, Shift+F4: Repeate find (after clsoing find dialog)
Ctrl+Alt+Z: Switch between last four editing places
Ctrl+PageUp/Down: Move to previous/next editing place
Ctrl+Alt+Home: Select browse option
Ctrl+Alt+P/O/N/I: Print Layout/Outline/Draft/Print Preview
Ctrl+Alt+1/2/3: Apply Header 1/2/3
Alt+Shift+O/I/X: Insert ToC/Citation /Index entry
Ctrl+Alt+F/D: Insert Footnote/Endnote
Ctrl+F3: Cut and collect to spike
Ctrl+Shift+F3: Paste and empty whole spike
Ctrl+Alt+C/R/T/MINUS/PERIOD: Copyright/Registered/Trademark/EmHyphen/Ellipsis
Shift+F3:Change case

I was working on a spread sheet in excel 2007 and suddenly reallized that there is no column A. It was starting from B!. I could not remember when I had hidden that column. Column contained information, but was not very important one – or atleast I did not need to see that data very often. I thought, may be, in one of my frenzies, I would have hidden that column for a reason I cannot make out today
. I googled to find how to unhide column A. Then as per my finding, I used Ctrl+G to pop up Go to Dialog, and I asked excel to go to A1. Then I went to Home tab and then to Format drop down -> Hide and Unhide menu to unhide column. DID NOT WORK!
Then there was stroke of light. I had frozen panes! I unfroze them and voila, column A was there again.
I am now laughing on myself.