Posted By

BrentS on 07/29/11


Tagged


Versions (?)

KeyValuePair System.Collections.Generic


 / Published in: C#
 

Simple example of a Key Value Pair using System.Collections.Generic.

  1. using System.Collections.Generic;
  2.  
  3. Dictionary<int, bool> MyDictionary = new Dictionary<int, bool>();
  4.  
  5. MyDictionary.Add(1, true);
  6.  
  7. foreach (KeyValuePair<int, bool> dictitem in MyDictionary)
  8. {
  9. if (dictitem.Key == 1)
  10. }

Report this snippet  

You need to login to post a comment.