c# key value code example
Example 1: c# keyvaluepair
// When you use foreach to enumerate dictionary elements,
// the elements are retrieved as KeyValuePair objects.
Console.WriteLine();
foreach( KeyValuePair<string, string> kvp in openWith )
{
Console.WriteLine("Key = {0}, Value = {1}",
kvp.Key, kvp.Value);
}
Example 2: c sharp add item to dictionary
// To add an item to a dictionary use 'Add()'
dict.Add(1,"One");
Example 3: c# dictionary functions
Dictionary<int, Func<string, bool>>