예제 #1
0
 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"
             });
         }
     }
 }
예제 #2
0
파일: WordPack.cs 프로젝트: avilon/Memorize
 /// <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);
         }
     }
 }