home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Audio / Office2010 / InfoPath.en-us / InfLR.cab / FL_attribute_snippet_121827_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2009-04-01  |  3KB  |  89 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8" ?>
  2. <CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3.     <CodeSnippet Format="1.0.0">
  4.         <Header>
  5.             <Title>attribute</Title>
  6.             <Shortcut>attribute</Shortcut>
  7.             <Description>Code snippet for attribute using recommended pattern</Description>
  8.             <Author>Microsoft Corporation</Author>
  9.             <SnippetTypes>
  10.                 <SnippetType>Expansion</SnippetType>
  11.             </SnippetTypes>
  12.         </Header>
  13.         <Snippet>
  14.             <Declarations>
  15.                 <Literal>
  16.                     <ID>name</ID>
  17.                     <ToolTip>The name of your attribute</ToolTip>
  18.                     <Default>My</Default>
  19.                 </Literal>
  20.                 <Literal>
  21.                     <ID>target</ID>
  22.                     <Default>All</Default>
  23.                 </Literal>
  24.                 <Literal>
  25.                     <ID>inherited</ID>
  26.                     <Default>false</Default>
  27.                 </Literal>
  28.                 <Literal>
  29.                     <ID>allowmultiple</ID>
  30.                     <Default>true</Default>
  31.                 </Literal>
  32.                 <Literal Editable="false">
  33.                     <ID>SystemAttribute</ID>
  34.                     <Function>SimpleTypeName(global::System.Attribute)</Function>
  35.                 </Literal>
  36.                 <Literal Editable="false">
  37.                     <ID>SystemAttributeUsage</ID>
  38.                     <Function>SimpleTypeName(global::System.AttributeUsage)</Function>
  39.                 </Literal>
  40.                 <Literal Editable="false">
  41.                     <ID>SystemAttributeTargets</ID>
  42.                     <Function>SimpleTypeName(global::System.AttributeTargets)</Function>
  43.                 </Literal>
  44.                 <Literal Editable="false">
  45.                     <ID>Exception</ID>
  46.                     <Function>SimpleTypeName(global::System.Exception)</Function>
  47.                 </Literal>
  48.             </Declarations>
  49.             <Code Language="csharp"><![CDATA[ [$SystemAttributeUsage$($SystemAttributeTargets$.$target$, Inherited = $inherited$, AllowMultiple = $allowmultiple$)]
  50. sealed class $name$Attribute : $SystemAttribute$
  51. {
  52.     // See the attribute guidelines at 
  53.     //  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconusingattributeclasses.asp
  54.     readonly string _positionalString;
  55.     int _namedInt;
  56.     
  57.    // This is a positional argument.
  58.    public $name$Attribute (string positionalString) 
  59.    { 
  60.         this._positionalString = positionalString;
  61.         
  62.        // TODO: Implement code here.
  63.        $end$throw new $Exception$("The method or operation is not implemented.");       
  64.    }
  65.    public string PositionalString 
  66.    { 
  67.       get 
  68.       {
  69.          return this._positionalString; 
  70.       }
  71.    }
  72.    // This is a named argument.
  73.    public int NamedInt
  74.    { 
  75.       get 
  76.       {
  77.          return this._namedInt;
  78.       }
  79.       set 
  80.       {
  81.          this._namedInt = value;
  82.       }
  83.    } 
  84. }
  85. ]]>
  86.             </Code>
  87.         </Snippet>
  88.     </CodeSnippet>
  89. </CodeSnippets>