예제 #1
0
 public RecordControl(MainWindow mainWindow)
 {
     InitializeComponent();
     User    = mainWindow.User;
     MainWin = mainWindow;
     if (User != null)
     {
         RecordService.ShowUserWords(User, 0).ForEach(r => LearnedWords.Add(r.KeyWord));
         RecordService.ShowUserWords(User, 1).ForEach(r => LearningWords.Add(r.KeyWord));
         this.listBox1.DataSource = LearnedWords;
         this.listBox2.DataSource = Datas.Lexicon[6];//暂定
         this.listBox3.DataSource = RecordService.ShowReadPara(User);
         List <string> quesList = new List <string>();
         RecordService.ShowQuesSet(User).ForEach(q =>
         {
             if (q.IsPass == true)
             {
                 quesList.Add("√" + q.Problem);
             }
             else
             {
                 quesList.Add("×" + q.Problem);
             }
         });
         this.listBox4.DataSource = quesList;
     }
 }
예제 #2
0
        /*public WordsPair this[string s]
         * {
         *  get { return Dict[s];  }
         *  set { Dict[s] = value;  }
         * }*/

        public void Add(WordsPair pair)
        {
            pair.WordStudied += moveWordPair;
            if (pair.Studied)
            {
                LearnedWords.Add(pair);
            }
            else
            {
                WordsToStudy.Add(pair);
            }
        }
예제 #3
0
 public void moveWordPair(WordsPair wPair)
 {
     if (wPair.Studied)
     {
         if (WordsToStudy.Remove(wPair))
         {
             LearnedWords.Add(wPair);
         }
     }
     if (WordsToStudy.Count == 0)
     {
         WordsToStudy = LearnedWords;
         LearnedWords = new List <WordsPair>();
         foreach (WordsPair pair in WordsToStudy)
         {
             pair.Reset();
         }
     }
 }