public void Load(string path) { items.Clear(); filePath = path; using (System.IO.StreamReader reader = new System.IO.StreamReader(path)) { string line; while ((line = reader.ReadLine()) != null) { if (!String.IsNullOrEmpty(line)) { DictItem di = new DictItem(); di.Read(line); items.Add(di.Caption, di); } } selectedIndex = 0; if (itemsChanged != null) { itemsChanged(new WordSetChange { Count = items.Count, OperationName = "Loaded" }); } } }
/// <summary> /// Загружает набор слов /// </summary> /// <param name="path">Размещение фала словаря</param> public void Load(string path) { items.Clear(); filePath = path; using (System.IO.StreamReader reader = new System.IO.StreamReader(path)) { string line; while ((line = reader.ReadLine()) != null) { if (!String.IsNullOrEmpty(line)) { DictItem di = new DictItem(); di.Read(line); items.Add(di.Caption, di); } } selectedIndex = 0; if (dictionaryLoaded != null) { dictionaryLoaded(items.Count); } } }