補助ツール


<スニペット>

INotifyPropertyChanged を継承したクラスのプロパティに関するコーディングをスニペットで補助します
propnotify.snippet」の名前などで保存して C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC#\Snippets\1041 等にファイルを置きます
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
	<Header>
		<Title>propnotify</Title>
		<Shortcut>propnotify</Shortcut>
		<Description>INotifyPropertyChanged をバッキングストアとして使用するプロパティのコードスニペット</Description>
		<Author>Microsoft Corporation</Author>
		<SnippetTypes>
			<SnippetType>Expansion</SnippetType>
		</SnippetTypes>
	</Header>
	<Snippet>
		<Declarations>
			<Literal>
				<ID>type</ID>
				<ToolTip>Property type</ToolTip>
				<Default>int</Default>
			</Literal>
			<Literal>
				<ID>property</ID>
				<ToolTip>Property name</ToolTip>
				<Default>MyProperty</Default>
			</Literal>
		</Declarations>
		<Code Language="csharp">
         <![CDATA[	#region $property$

 private $type$ _$property$;
public $type$ $property$
{
	get { return _$property$; }
	set
	{
     if(_$property$ != value)
     {
		  _$property$ = value;
       if(PropertyChanged!=null) PropertyChanged(this, new PropertyChangedEventArgs("$property$"));
     }
	}
}

#endregion
$end$]]>
		</Code>
	</Snippet>
</CodeSnippet>
</CodeSnippets>
最終更新:2012年11月09日 12:15
添付ファイル