How to create a code snippet
How to Manage Code Snippets Here is an example string property you can invoke by wpptabtab. Then you tab through the parts to fill out:
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>SharePoint Web Part Property</Title>
<Description>Create a SharePoint Web Part Property, Field and Default Field</Description>
<Author>Revised by Kit Menke, Original Author: Morgan Everett</Author>
<Shortcut>wpp</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Replace with the tyoe of the Web Part Property</ToolTip>
<Default>string</Default>
</Literal>
<Literal>
<ID>PropertyName</ID>
<ToolTip>Replace with the Name of the Web Part Property</ToolTip>
<Default>MyWebPartProperty</Default>
</Literal>
<Literal>
<ID>Category</ID>
<ToolTip>Replace with the name of the Category where this property will appear in the ToolPane</ToolTip>
<Default>TOOLBOX_SECTION_NAME</Default>
</Literal>
<Literal>
<ID>MyFriendlyName</ID>
<ToolTip>Replace with the Friendly Name of the Web Part Property</ToolTip>
<Default>MyFriendlyName</Default>
</Literal>
<Literal>
<ID>MyDescription</ID>
<ToolTip>Replace with the Description of the Web Part Property</ToolTip>
<Default>MyDescription</Default>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[private const $type$ DEFAULT_$PropertyName$ = "MyDefault";
private $type$ _$PropertyName$ = DEFAULT_$PropertyName$;
[Browsable(true)]
[Category($Category$)]
[DefaultValue(DEFAULT_$PropertyName$)]
[WebPartStorage(Storage.Shared)]
[FriendlyName("$MyFriendlyName$")]
[Description("$MyDescription$")]
public $type$ $PropertyName$
{
get { return this._$PropertyName$; }
set { this._$PropertyName$ = value; }
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Define TOOLBOX_SECTION_NAME
as a const string
at the top of your web part class to group them all together.