Here are 2 snippets I wrote that I find missing: one for regions creation and another for “Console.ReadLine()”, which is peculiarly missing, since its’ other brother “Console.WriteLine()” is already there..
Regions snippet:
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>Regions Snippet</Title> <Author>Gal Segal</Author> <Shortcut>reg</Shortcut> <Description>Adds regions to class code</Description> </Header> <Snippet> <Code Language="CSharp"> #region Private Members #endregion #region Ctor #endregion #region Properties #endregion #region Methods #region Public #endregion #region Private #endregion #endregion </Code> </Snippet> </CodeSnippet> </CodeSnippets>
Console.ReadLine() Snippet:
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>Console.Read() Snippet</Title> <Author>Gal Segal</Author> <Shortcut>cr</Shortcut> <Description>Writes "Console.Read();"</Description> </Header> <Snippet> <Code Language="CSharp"> Console.Read(); </Code> </Snippet> </CodeSnippet> </CodeSnippets>
Usage
- Copy the snippet code, and save it a text file with the extension “.snippet” (like “regions.snippet”).
- In Visual Studio, under Tool, click the Code Snippet Manager. (or Ctrl+k, Ctrl+B).
- In the Language DropDown, choose C#.
- Select one of the folders. (I choose “My Code Snippets”).
- Click the “Import” button and select the snippet file.
- Try it by typing the shortcut.
- You’re done!
Happy Coding :)