示例#1
0
        //Erstellt die Userauswahl für das Drop down Menu der User
        private void comboBoxUser_MouseClick(object sender, MouseEventArgs e)
        {
            UserReader  iu   = new UserReader();
            List <User> list = iu.import(txtPfadUser.Text);

            comboBoxUser.Items.Clear();
            foreach (User user in list)
            {
                comboBoxUser.Items.Add(user.Name);
            }
            comboBoxUser.BackColor = Color.White;
        }
示例#2
0
        //Vergleicht die Vokabeln
        private void btnMatch_Click(object sender, EventArgs e)
        {
            if (currentVok.Fremdsprache.Equals(txtLang2.Text))
            {
                thumbs(pictureBoxThumbs, 1);
                btnNextGame.Visible = true;
                if (rbtnSoundOn.Checked)
                {
                    playSound(true);
                }

                //Userdatei wird angepasst
                UserReader  ur   = new UserReader();
                List <User> list = ur.import(txtPfadUser.Text);
                foreach (User user in list)
                {
                    if (user.Name == comboBoxUser.SelectedItem.ToString())
                    {
                        user.istRichtig(currentVok.Deutsch, true);
                    }
                }
                var uw = new UserWriter(txtPfadUser.Text);
                uw.export(list);
            }
            else
            {
                thumbs(pictureBoxThumbs, 0);
                btnCorrectAnswer.Visible = true;
                btnNextGame.Visible      = true;
                if (rbtnSoundOn.Checked)
                {
                    playSound(false);
                }

                //Userdatei wird angepasst
                UserReader  iu   = new UserReader();
                List <User> list = iu.import(txtPfadUser.Text);
                foreach (User user in list)
                {
                    if (user.Name == comboBoxUser.SelectedItem.ToString())
                    {
                        user.istRichtig(currentVok.Deutsch, false);
                    }
                }
                var uw = new UserWriter(txtPfadUser.Text);
                uw.export(list);
            }
        }