Commit for development environment setup
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0"?>
|
||||
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
|
||||
<CodeSnippet Format="1.0.0">
|
||||
<Header>
|
||||
<Title>Add a criteria class</Title>
|
||||
<Author>Rockford Lhotka</Author>
|
||||
<Description>Add a nested criteria class to a CSLA .NET business class.</Description>
|
||||
<Shortcut>cslacrit</Shortcut>
|
||||
</Header>
|
||||
<Snippet>
|
||||
<Declarations>
|
||||
<Literal>
|
||||
<ID>ClassName</ID>
|
||||
<Default>Criteria</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>IdField</ID>
|
||||
<Type>String</Type>
|
||||
<Default>_id</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>IdType</ID>
|
||||
<Type>String</Type>
|
||||
<ToolTip>Type of the id field</ToolTip>
|
||||
<Default>int</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>IdProperty</ID>
|
||||
<Type>String</Type>
|
||||
<ToolTip>Name of the id property</ToolTip>
|
||||
<Default>Id</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>IdParam</ID>
|
||||
<Type>String</Type>
|
||||
<ToolTip>Parameter name for id value</ToolTip>
|
||||
<Default>id</Default>
|
||||
</Literal>
|
||||
</Declarations>
|
||||
<Code Language="CSharp" Kind="type decl"><![CDATA[[Serializable()]
|
||||
private class $ClassName$
|
||||
{
|
||||
private $IdType$ $IdField$;
|
||||
public $IdType$ $IdProperty$
|
||||
{
|
||||
get { return $IdField$; }
|
||||
}
|
||||
|
||||
public $ClassName$($IdType$ $IdParam$)
|
||||
{
|
||||
$IdField$ = $IdParam$;
|
||||
}
|
||||
}
|
||||
]]></Code>
|
||||
</Snippet>
|
||||
</CodeSnippet>
|
||||
</CodeSnippets>
|
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0"?>
|
||||
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
|
||||
<CodeSnippet Format="1.0.0">
|
||||
<Header>
|
||||
<Title>Insert business regions</Title>
|
||||
<Author>Rockford Lhotka</Author>
|
||||
<Description>Insert CSLA .NET business regions.</Description>
|
||||
<Shortcut>cslabiz</Shortcut>
|
||||
</Header>
|
||||
<Snippet>
|
||||
<Code Language="CSharp"><![CDATA[#region Business Methods
|
||||
|
||||
// TODO: add public properties and methods
|
||||
|
||||
protected override object GetIdValue()
|
||||
{
|
||||
// TODO: return unique id value for object
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Validation Rules
|
||||
|
||||
protected override void AddBusinessRules()
|
||||
{
|
||||
// TODO: add validation rules
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Authorization Rules
|
||||
|
||||
protected override void AddAuthorizationRules()
|
||||
{
|
||||
// TODO: add authorization rules
|
||||
}
|
||||
|
||||
#endregion]]></Code>
|
||||
</Snippet>
|
||||
</CodeSnippet>
|
||||
</CodeSnippets>
|
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0"?>
|
||||
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
|
||||
<CodeSnippet Format="1.0.0">
|
||||
<Header>
|
||||
<Title>Insert data access region</Title>
|
||||
<Author>Rockford Lhotka</Author>
|
||||
<Description>Insert CSLA .NET data access region.</Description>
|
||||
<Shortcut>csladata</Shortcut>
|
||||
</Header>
|
||||
<Snippet>
|
||||
<Declarations>
|
||||
<Literal>
|
||||
<ID>IdType</ID>
|
||||
<ToolTip>Replace with the Id variable type.</ToolTip>
|
||||
<Default>int</Default>
|
||||
</Literal>
|
||||
</Declarations>
|
||||
<Code Language="CSharp"><![CDATA[#region Data Access
|
||||
|
||||
[Serializable()]
|
||||
private class Criteria
|
||||
{
|
||||
private $IdType$ mId;
|
||||
public $IdType$ Id
|
||||
{
|
||||
get
|
||||
{ return mId; }
|
||||
}
|
||||
public Criteria($IdType$ id)
|
||||
{ mId = id; }
|
||||
}
|
||||
|
||||
protected override void DataPortal_Create()
|
||||
{
|
||||
// TODO: load default values into object
|
||||
}
|
||||
|
||||
private void DataPortal_Fetch(Criteria criteria)
|
||||
{
|
||||
// TODO: load values into object
|
||||
}
|
||||
|
||||
protected override void DataPortal_Insert()
|
||||
{
|
||||
// TODO: insert object's data
|
||||
}
|
||||
|
||||
protected override void DataPortal_Update()
|
||||
{
|
||||
// TODO: update object's data
|
||||
}
|
||||
|
||||
protected override void DataPortal_DeleteSelf()
|
||||
{
|
||||
DataPortal_Delete(new Criteria($IdName$));
|
||||
}
|
||||
|
||||
private void DataPortal_Delete(Criteria criteria)
|
||||
{
|
||||
// TODO: delete object's data
|
||||
}
|
||||
|
||||
#endregion]]></Code>
|
||||
</Snippet>
|
||||
</CodeSnippet>
|
||||
</CodeSnippets>
|
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0"?>
|
||||
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
|
||||
<CodeSnippet Format="1.0.0">
|
||||
<Header>
|
||||
<Title>Define common Csla Factory Methods</Title>
|
||||
<Author>Rockford Lhotka</Author>
|
||||
<Description>Defines common Csla-style factory methods.</Description>
|
||||
<Shortcut>cslafact</Shortcut>
|
||||
</Header>
|
||||
<Snippet>
|
||||
<Declarations>
|
||||
<Literal>
|
||||
<ID>ClassName</ID>
|
||||
<Type>String</Type>
|
||||
<ToolTip>Replace with class name.</ToolTip>
|
||||
<Default>BusinessClass</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>CriteriaClassName</ID>
|
||||
<Type>String</Type>
|
||||
<ToolTip>Replace with the Criteria class name.</ToolTip>
|
||||
<Default>Criteria</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>IdName</ID>
|
||||
<Type>String</Type>
|
||||
<ToolTip>Replace with Id (primary key) variable name.</ToolTip>
|
||||
<Default>id</Default>
|
||||
</Literal>
|
||||
<Literal>
|
||||
<ID>IdType</ID>
|
||||
<ToolTip>Replace with the Id (primary key) variable type.</ToolTip>
|
||||
<Default>int</Default>
|
||||
</Literal>
|
||||
</Declarations>
|
||||
<Code Language="CSharp"><![CDATA[#region Factory Methods
|
||||
|
||||
public static $ClassName$ New$ClassName$()
|
||||
{
|
||||
return DataPortal.Create<$ClassName$>();
|
||||
}
|
||||
|
||||
public static $ClassName$ Get$ClassName$($IdType$ $IdName$)
|
||||
{
|
||||
return DataPortal.Fetch<$ClassName$>(new $CriteriaClassName$($IdName$));
|
||||
}
|
||||
|
||||
public static void Delete$ClassName$($IdType$ $IdName$)
|
||||
{
|
||||
DataPortal.Delete(new $CriteriaClassName$($IdName$));
|
||||
}
|
||||
|
||||
private $ClassName$()
|
||||
{ /* Require use of factory methods */ }
|
||||
|
||||
#endregion]]></Code>
|
||||
</Snippet>
|
||||
</CodeSnippet>
|
||||
</CodeSnippets>
|
@@ -0,0 +1,53 @@
|
||||
<?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>
|
@@ -0,0 +1,43 @@
|
||||
<?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>
|
Reference in New Issue
Block a user