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_IteratingThroughASortedDictionaryByKey__142572_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2008-09-17  |  2KB  |  52 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>Iterate through a sorted dictionary by key.</Title>
  6.       <Author>Microsoft Corporation</Author>
  7.       <Description>Iterates through all the items in a dictionary based on the sorted list of keys.</Description>
  8.       <Shortcut>colIterSort</Shortcut>
  9.     </Header>
  10.     <Snippet>
  11.       <Imports>
  12.         <Import>
  13.           <Namespace>Microsoft.VisualBasic</Namespace>
  14.         </Import>
  15.       </Imports>
  16.       <Declarations>
  17.         <Literal>
  18.           <ID>itemVar</ID>
  19.           <ToolTip>Replace with an identifier for an item in the collection.</ToolTip>
  20.           <Default>student</Default>
  21.         </Literal>
  22.         <Literal>
  23.               <ID>keyVar</ID>
  24.               <ToolTip>Replace with an identifier for a key in the collection.</ToolTip>
  25.               <Default>rank</Default>
  26.         </Literal>
  27.           <Literal>
  28.               <ID>keyType</ID>
  29.               <ToolTip>Replace with the type of a key in the collection.</ToolTip>
  30.               <Default>Integer</Default>
  31.           </Literal>
  32.           <Literal>
  33.           <ID>itemType</ID>
  34.           <ToolTip>Replace with the type of items in the collection.</ToolTip>
  35.           <Default>String</Default>
  36.         </Literal>
  37.         <Object>
  38.             <ID>dicVar</ID>
  39.             <Type>IDictionary(Of TKey, TValue)</Type>
  40.             <ToolTip>Replace with the sorted dictionary to iterate over.</ToolTip>
  41.             <Default>sortedStudents</Default>
  42.         </Object>
  43.       </Declarations>
  44.       <Code Language="VB" Kind="method body">
  45.           <![CDATA[ ' Loop through the items based on key
  46.         For Each $keyVar$ As $keyType$ In $dicVar$.Keys
  47.             Dim $itemVar$ As $itemType$ = $dicVar$.Item($keyVar$)
  48.  
  49.         Next]]></Code>
  50.     </Snippet>
  51.   </CodeSnippet>
  52. </CodeSnippets>