コード例 #1
0
ファイル: Form1.cs プロジェクト: jacksparrow47/EnglishWord
 /// <summary> 
 /// xml dosyasına yeni kelime ekleme işlemi
 /// </summary>
 private void btnadd_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtword.Text) && !string.IsNullOrEmpty(txtanswear.Text))
     {
         try
         {
             Word w = new Word();
             w.WordId = Guid.NewGuid();
             w.WordTur = txtanswear.Text;
             w.WordEng = txtword.Text;
             w.Sentences = txtsentence.Text;
             /// <summary>
             /// xml dosyasına yeni kelime ekleme
             /// </summary>
             _doc.Root.Add(new XElement("word", new XElement("WordId", w.WordId), new XElement("WordTur", w.WordTur), new XElement("WordEng", w.WordEng), new XElement("Sentences", w.Sentences)));
             _doc.Save(filepath);
             MessageBox.Show("işlem atamamlandı");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message.ToString());
         }
         ReadXml();
         CleanAddParameter();
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jacksparrow47/EnglishWord
 /// <summary> 
 /// bir sonraki kelimeye geçmek için kullanılır.
 /// </summary>
 private void btnnext_Click(object sender, EventArgs e)
 {
     int find = 0;
     for (int i = 0; i < _listWord.Count; i++)
     {
         if (_listWord[i].WordId == _curent.WordId)
             find = i + 1;
     }
     if (find >= 0 && find<_listWord.Count)
     {
         _curent = _listWord[find];
     }
     if (_curent != null)
     {
         lblid.Text = _curent.WordId.ToString();
         lblword.Text = _curent.WordEng;
     }
     CleanShowParameter();
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: jacksparrow47/EnglishWord
 /// <summary> 
 /// program başlangıcında yapılacak işlemler
 /// </summary>
 private void Default()
 {
     ReadXml();
     _curent = _listWord.FirstOrDefault();
     if (_curent != null)
     {
         lblid.Text = _curent.WordId.ToString();
         lblword.Text = _curent.WordEng;
     }
 }