Skip to content

Instantly share code, notes, and snippets.

@taross-f
Last active May 23, 2016 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taross-f/3aacf041d245e016252eaca7c50b63e5 to your computer and use it in GitHub Desktop.
Save taross-f/3aacf041d245e016252eaca7c50b63e5 to your computer and use it in GitHub Desktop.
C#6.0 get-only property snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propgo</Title>
<Shortcut>propgo</Shortcut>
<Description>'get' アクセサーを使用する、get-onlyプロパティ用のコード スニペット
言語バージョン: C# 6 以降</Description>
<Author>taro.furuya@gmail.com</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>プロパティの型</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>プロパティ名</ToolTip>
<Default>MyProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public $type$ $property$ { get; }$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment