Esempio n. 1
0
 public void Update(DictItem di)
 {
     if (items.Remove(di.Caption))
     {
         Add(di);
     }
 }
Esempio n. 2
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"
             });
         }
     }
 }
Esempio n. 3
0
 public void Update(DictItem di)
 {
     if (items.Remove(di.Caption))
     {
         Add(di);
         if (updateItem != null)
         {
             updateItem();
         }
     }
 }
Esempio n. 4
0
 public void Add(DictItem di)
 {
     try
     {
         items.Add(di.Caption, di);
         if (addItem != null)
         {
             addItem(di.Caption);
         }
     }
     catch (Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.ToString(), "Караул !!!", System.Windows.Forms.MessageBoxButtons.OK);
     }
 }
Esempio n. 5
0
 public void Add(DictItem di)
 {
     try
     {
         items.Add(di.Caption, di);
         if (itemsChanged != null)
         {
             itemsChanged(new WordSetChange
             {
                 Count         = items.Count,
                 OperationName = "Append", Message = di.Caption
             });
         }
     }
     catch (Exception e)
     {
         System.Windows.Forms.MessageBox.Show(e.ToString(), "Караул !!!", System.Windows.Forms.MessageBoxButtons.OK);
     }
 }
Esempio n. 6
0
 /// <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);
         }
     }
 }