Just put them in files "string.Empty.snippet" and "string.Format.snippet" in folder "My Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets".
More on creating code snippets:
http://msdn.microsoft.com/en-us/library/ms165393(VS.80).aspx.
string.Empty:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>se</Title>
<Shortcut>se</Shortcut>
<Description>Code snippet for "string.Empty"</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[string.Empty$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
string.Format():
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>sf</Title>
<Shortcut>sf</Shortcut>
<Description>Code snippet for "string.Format()"</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[string.Format($selected$$end$)]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
No comments:
Post a Comment