Hi Bruce,
You can write your own snippets, as I suggested. VS.NET 2005 even gives you intellisense for the XML schema. It really is simple.
Here's a snippet that you can name, "method.snippet " and place in your My Documents/Visual Studio 2005/Code Snippets folder. Extend
it all you want.
For now it generates the following method stub:
public $return$ $name$()
{
$end$
}
[void] is an input parameter that VS.NET 2005 treats as an input box. Tab through each input box and enter the appropriate data,
with the exception of [end]. Press the 'Enter' key when you are finished filling in the variables. [end] is where the cursor is
placed after you hit 'Enter'.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microso ft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Public Parameterless Method</Title>
<Shortcut>metho d</Shortcut>
<Description>St ubs out a simple, public method without any parameters.</Description>
<Author>Copyrig ht (c) 2006 Dave Sexton</Author>
<SnippetTypes >
<SnippetType>Ex pansion</SnippetType>
<SnippetType>Su rroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations >
<Literal Editable="true" >
<ID>return</ID>
<Default>void </Default>
</Literal>
<Literal Editable="true" >
<ID>name</ID>
<Default>Method Name</Default>
</Literal>
</Declarations>
<Code Language="cshar p">
<![CDATA[public $return$ $name$()
{
$end$
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
--
Dave Sexton
"Bruce One" <ra**@virtualso ftware.com.brwr ote in message news:54******** *************** ***********@mic rosoft.com...
Thats true, this snippet code may help in If statements...
But what about when we write a new method ? Then we have to write the 2
parenthesis and after the 2 braces...its not possible to let IDE fill it for
us, like in VB.NET right?
"Dave Sexton" wrote:
>If your using VS.NET 2005 you can just type the word "if" and then hit tab. "if" is a built-in code snippet. You can write your
own code snippets if you'd like and place them in your "My Documents/Visual Studio 2005/Code Snippets" folder. VS.NET picks them
up
without even having to restart the IDE.
If your using an older version I think you might be out of luck. Maybe you could write an addin and assign it to a specific
keyboard shortcut, but I'm not sure how difficult that would be.
--
Dave Sexton
"Bruce One" <ra**@virtualso ftware.com.brwr ote in message news:50******** *************** ***********@mic rosoft.com...
Does anyone know a way to make the IDE close braces in Ifs statements
(methods also) for C# ?
In VB.NET you have an automatic closing...