53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.6 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 Property</Title>
 | |
|       <Author>Rockford Lhotka</Author>
 | |
|       <Description>Defines a Csla-style Property with a backing field.</Description>
 | |
|       <Shortcut>cslaprop</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[$PropertyType$ $PrivateVariable$;
 | |
| public $PropertyType$ $PropertyName$
 | |
| {
 | |
|   [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
 | |
|   get
 | |
|   {
 | |
|     CanReadProperty(true) ;
 | |
|     return $PrivateVariable$;
 | |
|   }
 | |
|   [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
 | |
|   set
 | |
|   {
 | |
|     CanWriteProperty(true);
 | |
|     if (!$PrivateVariable$.Equals(value))
 | |
|     {
 | |
|       $PrivateVariable$ = value;
 | |
|       PropertyHasChanged();
 | |
|     }
 | |
|   }
 | |
| }]]></Code>
 | |
|     </Snippet>
 | |
|   </CodeSnippet>
 | |
| </CodeSnippets> |