Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PreSaveProcessing
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01428468
Message ID:
01429929
Views:
48
When I overloaded my constructors and added a property to all of my ABusinessObjects, I created the snippets below to help with the typing. Hope they help someone else.

Just add the following with the VS Code Snippet Manager and then you can type:

muProp tab tab to create a property called UserName;
muCTOR tab tab to overload the contructor to accept the property.
<?xml version="1.0" encoding="utf-8"?>

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">

    <Header>
      <Title>
        muCTOR
      </Title>
      <Shortcut>muCTOR</Shortcut>
    </Header>
    <Snippet>
      <Code Language="CSharp">
        <![CDATA[		
		/// <summary>
		/// Overload Constructor
		/// </summary>
    public $ConstructorName$(string userName):this()
		{
			this.UserName = userName;       
		}     
    ]]>
      </Code>
      <Declarations>
        <Literal>
          <ID>ConstructorName</ID>
          <Function>ClassName()</Function>
          <Default>ClassName()</Default>
          <ToolTip>Replace with the Constructor name</ToolTip>
        </Literal>
      </Declarations>
    </Snippet>
  </CodeSnippet>

  <CodeSnippet Format="1.0.0">

    <Header>
      <Title>
        mbProp
      </Title>
      <Shortcut>muprop</Shortcut>
    </Header>
    <Snippet>
      <Code Language="CSharp">
        <![CDATA[		
		public string UserName
		{
			get
      {
        return this._userName;
      }
      set
      {
        this._userName = value;
      }
		} 
    private string _userName;
    ]]>
      </Code>
    </Snippet>
  </CodeSnippet>

</CodeSnippets>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform