public static void PrintAllValues <K1, K2, V>(IBiDictionary <K1, K2, V> biDictionary) { Console.WriteLine("\nCount: " + biDictionary.Count); foreach (var value in biDictionary.Values) { Console.WriteLine(value); } }
private static void ReadDataFromFile(string filePath, IBiDictionary <string, int, string> dictionary) { using (StreamReader reader = new StreamReader(filePath)) { string line = reader.ReadLine(); while (line != string.Empty && line != null) { string[] data = line.Split('|'); string name = data[0].Trim(); string city = data[1].Trim(); int age = int.Parse(data[2].Trim()); dictionary.Add(city, age, name); line = reader.ReadLine(); } } }
private static void ReadDataFromFile(string filePath, IBiDictionary<string, int, string> dictionary) { using (StreamReader reader = new StreamReader(filePath)) { string line = reader.ReadLine(); while (line != string.Empty && line != null) { string[] data = line.Split('|'); string name = data[0].Trim(); string city = data[1].Trim(); int age = int.Parse(data[2].Trim()); dictionary.Add(city, age, name); line = reader.ReadLine(); } } }