43 lines
1.4 KiB
Plaintext

<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Define a Csla Readonly Property</Title>
<Author>Rockford Lhotka</Author>
<Description>Defines a Csla-style readonly Property with a backing field.</Description>
<Shortcut>cslaroprop</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>PropertyName</ID>
<Type>String</Type>
<ToolTip>Replace with property name.</ToolTip>
<Default>NewProperty</Default>
</Literal>
<Literal>
<ID>PropertyType</ID>
<ToolTip>Replace with the property type.</ToolTip>
<Default>int</Default>
</Literal>
<Object>
<ID>PrivateVariable</ID>
<Type>Object</Type>
<ToolTip>Replace this with the private variable name.</ToolTip>
<Default>newPropertyValue</Default>
</Object>
</Declarations>
<Code Language="CSharp" Kind="method decl">
<![CDATA[private $PropertyType$ $PrivateVariable$;
public $PropertyType$ $PropertyName$
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return $PrivateVariable$;
}
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>