VisualStudio2010/コードスニペット
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
&tag(VisualStudio2010/コードスニペット);
*目次 [#e544063b]
#contents
*参考情報 [#t2745c72]
-[[Create a Snippet in Visual Studio 2010 | Vis...
-[[Visual Studio 2008 Tip: Resolving Namespaces and Remov...
*基本 [#q3dbfff3]
-「マイドキュメント\Visual Studio 2010\Code Snippets\Visu...
-Visual Studioを起動し直すと自動で読み込まれる。
-読み込まれたかどうかは、[ツール]→[コードスニペットマネー...
*C#用/WPF [#qee058d1]
-以下を読み込ませておき、vsのエディタでpropnchを入力後タ...
#pre{{
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/Visual...
<CodeSnippet Format="1.0.0">
<Header>
<Title>propnch</Title>
<Shortcut>propnch</Shortcut>
<Description>Code snippet for property and backing ...
<Author>Abhishek</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>
<Literal>
<ID>field</ID>
<ToolTip>The variable backing this property</To...
<Default>myVar</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[
private $type$ $field$;
public $type$ $property$
{
get
{
return $field$;
}
set
{
if ($field$ != value)
{
$field$ = value;
NotifyPropertyChanged("$property$");
}
}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>notifypc</Title>
<Shortcut>notifypc</Shortcut>
<Description>Code snippet for NotifyPropertyChanged...
<Author>mt</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEven...
}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>obs</Title>
<Shortcut>obs</Shortcut>
<Description>ObservableCollection</Description>
<Author>mt</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>string</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[ObservableCollection<$type$>$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>propobs</Title>
<Shortcut>propobs</Shortcut>
<Description>ObservableCollection Property</Descrip...
<Author>mt</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>string</Default>
</Literal>
<Literal>
<ID>field</ID>
<ToolTip>The variable backing this property</To...
<Default>myVar</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[
public ObservableCollection<$type$> $field$ {get;...
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
}}
終了行:
&tag(VisualStudio2010/コードスニペット);
*目次 [#e544063b]
#contents
*参考情報 [#t2745c72]
-[[Create a Snippet in Visual Studio 2010 | Vis...
-[[Visual Studio 2008 Tip: Resolving Namespaces and Remov...
*基本 [#q3dbfff3]
-「マイドキュメント\Visual Studio 2010\Code Snippets\Visu...
-Visual Studioを起動し直すと自動で読み込まれる。
-読み込まれたかどうかは、[ツール]→[コードスニペットマネー...
*C#用/WPF [#qee058d1]
-以下を読み込ませておき、vsのエディタでpropnchを入力後タ...
#pre{{
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/Visual...
<CodeSnippet Format="1.0.0">
<Header>
<Title>propnch</Title>
<Shortcut>propnch</Shortcut>
<Description>Code snippet for property and backing ...
<Author>Abhishek</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>
<Literal>
<ID>field</ID>
<ToolTip>The variable backing this property</To...
<Default>myVar</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[
private $type$ $field$;
public $type$ $property$
{
get
{
return $field$;
}
set
{
if ($field$ != value)
{
$field$ = value;
NotifyPropertyChanged("$property$");
}
}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>notifypc</Title>
<Shortcut>notifypc</Shortcut>
<Description>Code snippet for NotifyPropertyChanged...
<Author>mt</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEven...
}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>obs</Title>
<Shortcut>obs</Shortcut>
<Description>ObservableCollection</Description>
<Author>mt</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>string</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[ObservableCollection<$type$>$end$]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>propobs</Title>
<Shortcut>propobs</Shortcut>
<Description>ObservableCollection Property</Descrip...
<Author>mt</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>string</Default>
</Literal>
<Literal>
<ID>field</ID>
<ToolTip>The variable backing this property</To...
<Default>myVar</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[
public ObservableCollection<$type$> $field$ {get;...
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
}}
ページ名: