Skip to content

Instantly share code, notes, and snippets.

@jonathascosta
Last active December 11, 2015 03:48
Show Gist options
  • Select an option

  • Save jonathascosta/4540534 to your computer and use it in GitHub Desktop.

Select an option

Save jonathascosta/4540534 to your computer and use it in GitHub Desktop.
Rules property snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>Rules Property</Title>
<Author>Jonathas Piazzarollo Costa</Author>
<Shortcut>rulesproperty</Shortcut>
<Description>Creates a Rules property.</Description>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Rules class name</ToolTip>
<Default>Rules</Default>
</Literal>
<Literal>
<ID>member</ID>
<ToolTip>Member name</ToolTip>
<Default>_rules</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Property name</ToolTip>
<Default>Rules</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[private $type$ $member$;
public virtual $type$ $property$
{
get { return ($member$ != null) ? $member$ : new $type$(); }
set { $member$ = value; }
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment