Last active
September 29, 2015 15:05
-
-
Save bc3tech/6ab654137ec33b66f20f to your computer and use it in GitHub Desktop.
VS 2015 C# 6.0 code snippet for read-only properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Keywords> | |
<Keyword>property prop propr 6</Keyword> | |
</Keywords> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>propr</Title> | |
<Author>bc3tech</Author> | |
<Description>Code snippet for a read-only property | |
Language Version: C# 6.0 or higher</Description> | |
<HelpUrl> | |
</HelpUrl> | |
<Shortcut>propr</Shortcut> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal Editable="true"> | |
<ID>accessor</ID> | |
<ToolTip>accessor</ToolTip> | |
<Default>public</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>returnType</ID> | |
<ToolTip>returnType</ToolTip> | |
<Default>int</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>propertyName</ID> | |
<ToolTip>propertyName</ToolTip> | |
<Default>MyProperty</Default> | |
<Function> | |
</Function> | |
</Literal> | |
</Declarations> | |
<Code Language="csharp" Delimiter="$" Kind="method decl"><![CDATA[$accessor$ $returnType$ $propertyName$ { get; }]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment