Where is my Snippet?

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

 

Just for documentation purposes:

Folder with snippets:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC#\Snippets\1033\Visual C#

Snippet file example: model.snippet
”model” is shortname

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>model</Title>
      <Author>Damir Dobric</Author>
      <Description></Description>
      <HelpUrl></HelpUrl>
      <SnippetTypes />
      <Keywords />
      <Shortcut>model</Shortcut>
    </Header>
    <Snippet>
      <References />
      <Imports />
      <Declarations>
        <Literal Editable="true">
          <ID>TypeName</ID>
          <Type>System.Type</Type>
          <ToolTip></ToolTip>
          <Default>TypeName</Default>
          <Function></Function>
        </Literal>
        <Literal Editable="true">
          <ID>PropertyName</ID>
          <Type>System.String</Type>
          <ToolTip></ToolTip>
          <Default>TypeYourPropertyName</Default>
          <Function></Function>
        </Literal>
      </Declarations>
      <Code Language="csharp" Kind="" Delimiter="$">
  <![CDATA[
      private $TypeName$  m_$PropertyName$;

      public $TypeName$ $PropertyName$
      {
          get
        {
        return m_$PropertyName$;
          }
        set
        {
            if (m_$PropertyName$ != value)
            {
                this.m_$PropertyName$ = value;
            RaisePropertyChanged("$PropertyName$");
              }
          }
    }]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>


Posted Dec 13 2011, 04:19 PM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.