Visual Studio comes with some handy (and some not-so-handy) code snippets, but for some reason there isn't one for declaring a method. It isn't that big of a deal, but after a while you might start resenting finishing your method header, then having to type Enter, {, Enter, }, Up, Enter to start the method body. Here's a snippet that will automatically put an open and closing brace after your method declaration, with the cursor ready to go in between:
<?xml version="1.0" encoding="utf-8" ?><CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>method</Title> <Shortcut>m</Shortcut> <Description>Code snippet for methods</Description> <Author>Adam Anderson</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>method-modifiers</ID> <ToolTip>Method modifiers</ToolTip> <Default>public</Default> </Literal> <Literal> <ID>return-type</ID> <ToolTip>Return type</ToolTip> <Default>void</Default> </Literal> <Literal> <ID>member-name</ID> <ToolTip>Method name</ToolTip> <Default>Name</Default> </Literal> <Literal> <ID>param-list</ID> <ToolTip>Parameter list</ToolTip> </Default> </Literal> </Declarations> <Code Language="csharp"> <![CDATA[$method-modifiers$ $return-type$ $member-name$( $param-list$ ){$end$}]]> </Code> </Snippet> </CodeSnippet></CodeSnippets>
Remember Me
a@href@title, i, strike, u
Copyright © 2003-2008 Falafel Software Inc.
Subscribe to Falafel Blogs
The opinions expressed herein are Falafel's employees own personal opinions and do not represent Falafel Software's view in any way in case they go bananas!