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_CreateAStronglyTypedSortedDictionary_sn_142566_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2008-09-17  |  2KB  |  62 lines

  1. <?xml version="1.0"?>
  2. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3.   <CodeSnippet Format="1.0.0">
  4.     <Header>
  5.       <Title>Create a sorted dictionary.</Title>
  6.       <Author>Microsoft Corporation</Author>
  7.       <Description>Creates a sorted dictionary to hold a specific type of items.</Description>
  8.       <Shortcut>colCreateSort</Shortcut>
  9.     </Header>
  10.     <Snippet>
  11.       <Imports>
  12.         <Import>
  13.           <Namespace>Microsoft.VisualBasic</Namespace>
  14.         </Import>
  15.       </Imports>
  16.       <Declarations>
  17.           <Literal>
  18.               <ID>keyType</ID>
  19.               <ToolTip>Type of key.</ToolTip>
  20.               <Default>Integer</Default>
  21.           </Literal>
  22.           <Literal>
  23.           <ID>itemType</ID>
  24.           <ToolTip>Replace with the type of item the collection should hold.</ToolTip>
  25.           <Default>String</Default>
  26.         </Literal>
  27.         <Literal>
  28.           <ID>storageVar</ID>
  29.           <ToolTip>Replace with an identifier for the backing storage.</ToolTip>
  30.           <Default>sortedStudents</Default>
  31.         </Literal>
  32.         <Literal>
  33.           <ID>keyValue1</ID>
  34.           <ToolTip>Replace with the key for the first value.</ToolTip>
  35.           <Default>1</Default>
  36.         </Literal>
  37.           <Literal>
  38.               <ID>keyValue2</ID>
  39.               <ToolTip>Replace with the key for the second value.</ToolTip>
  40.               <Default>2</Default>
  41.           </Literal>
  42.           <Literal>
  43.               <ID>itemValue1</ID>
  44.               <ToolTip>Replace with the item for the first value.</ToolTip>
  45.               <Default>"Mary Chase"</Default>
  46.           </Literal>
  47.           <Literal>
  48.               <ID>itemValue2</ID>
  49.               <ToolTip>Replace with the item for the second value.</ToolTip>
  50.               <Default>"Barnaby Williams"</Default>
  51.           </Literal>
  52.       </Declarations>
  53.       <Code Language="VB" Kind="method body">
  54.           <![CDATA[        ' Backing storage -- a generic dictionary
  55.         Dim $storageVar$ As New SortedDictionary(Of $keyType$, $itemType$)
  56.  
  57.         ' Add items to the dictionary
  58.         $storageVar$.Add($keyValue1$, $itemValue1$)
  59.         $storageVar$.Add($keyValue2$, $itemValue2$)]]></Code>
  60.     </Snippet>
  61.   </CodeSnippet>
  62. </CodeSnippets>