Exemplo n.º 1
0
 public frmEditQuestions()
 {
     InitializeComponent();
     Vragen = new Dictionary<int, Vraag>();
     CurrentIndex = 0;
     CurrentVraag = new Vraag();
 }
Exemplo n.º 2
0
 public frmEditQuestions()
 {
     InitializeComponent();
     Vragen       = new Dictionary <int, Vraag>();
     CurrentIndex = 0;
     CurrentVraag = new Vraag();
 }
Exemplo n.º 3
0
        public Vraag getNextQuestion()
        {
            Vraag toReturn = VragenOver[NextIndex];

            VragenOver.Remove(NextIndex);
            NextIndex++;
            return(toReturn);
        }
Exemplo n.º 4
0
 public void setNextQuestion()
 {
     if (ApplicationHandler.Instance.isFinished())
     {
         closeApp = false;
         MainWindow.Show();
         this.Close();
         return;
     }
     toolstripAmountHad.Text = (totalGood + totalWrong + totalSkipped).ToString();
     tryAgain         = false;
     CurrentVraag     = ApplicationHandler.Instance.getNextQuestion();
     txtVraag.Text    = CurrentVraag.txtVraag;
     txtAntwoord.Text = "";
     txtAntwoord.Focus();
 }
Exemplo n.º 5
0
 public void setNextQuestion()
 {
     if (ApplicationHandler.Instance.isFinished())
     {
         closeApp = false;
         MainWindow.Show();
         this.Close();
         return;
     }
     toolstripAmountHad.Text = (totalGood + totalWrong + totalSkipped).ToString();
     tryAgain = false;
     CurrentVraag = ApplicationHandler.Instance.getNextQuestion();
     txtVraag.Text = CurrentVraag.txtVraag;
     txtAntwoord.Text = "";
     txtAntwoord.Focus();
 }
Exemplo n.º 6
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            CurrentVraag.txtVraag    = txtVraag.Text;
            CurrentVraag.txtAntwoord = txtAntwoord.Text;

            if (Vragen.ContainsKey(CurrentIndex))
            {
                Vragen[CurrentIndex] = CurrentVraag;
            }
            else
            {
                Vragen.Add(CurrentIndex, CurrentVraag);
            }

            TextWriter    Writer     = new StreamWriter(@"c:\users\henk\Documents\vragen\noooo.xml");
            XmlSerializer Serializer = new XmlSerializer(typeof(List <Vraag>));
            List <Vraag>  lstVragen  = new List <Vraag>();

            foreach (KeyValuePair <int, Vraag> entry in Vragen)
            {
                lstVragen.Add(entry.Value);
            }

            Serializer.Serialize(Writer, lstVragen);
            Writer.Close();

            CurrentIndex++;

            if (Vragen.ContainsKey(CurrentIndex))
            {
                CurrentVraag = Vragen[CurrentIndex];
            }
            else
            {
                CurrentVraag             = new Vraag();
                CurrentVraag.txtVraag    = "";
                CurrentVraag.txtAntwoord = "";
            }

            txtVraag.Text    = CurrentVraag.txtVraag;
            txtAntwoord.Text = CurrentVraag.txtAntwoord;
            txtVraag.Focus();
        }
Exemplo n.º 7
0
        private void btnPrev_Click(object sender, EventArgs e)
        {
            if (CurrentIndex > 0)
            {
                if (Vragen.ContainsKey(CurrentIndex - 1))
                {
                    CurrentVraag = Vragen[CurrentIndex - 1];
                    CurrentIndex--;
                }
                else
                {
                    int y = 120;
                    MessageBox.Show("Geen vorige vraag gevonden (?)");
                }



                txtVraag.Text    = CurrentVraag.txtVraag;
                txtAntwoord.Text = CurrentVraag.txtAntwoord;
            }
        }
Exemplo n.º 8
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            CurrentVraag.txtVraag = txtVraag.Text;
            CurrentVraag.txtAntwoord = txtAntwoord.Text;

            if (Vragen.ContainsKey(CurrentIndex))
            {
                Vragen[CurrentIndex] = CurrentVraag;
            }
            else
            {
                Vragen.Add(CurrentIndex, CurrentVraag);
            }

            TextWriter Writer = new StreamWriter(@"c:\users\henk\Documents\vragen\noooo.xml");
            XmlSerializer Serializer = new XmlSerializer(typeof(List<Vraag>));
            List<Vraag> lstVragen = new List<Vraag>();
            foreach (KeyValuePair<int, Vraag> entry in Vragen)
            {
                lstVragen.Add(entry.Value);
            }

            Serializer.Serialize(Writer, lstVragen);
            Writer.Close();

            CurrentIndex++;

            if (Vragen.ContainsKey(CurrentIndex))
                CurrentVraag = Vragen[CurrentIndex];
            else
            {
                CurrentVraag = new Vraag();
                CurrentVraag.txtVraag = "";
                CurrentVraag.txtAntwoord = "";
            }

            txtVraag.Text = CurrentVraag.txtVraag;
            txtAntwoord.Text = CurrentVraag.txtAntwoord;
            txtVraag.Focus();
        }
Exemplo n.º 9
0
        private void btnPrev_Click(object sender, EventArgs e)
        {
            if (CurrentIndex > 0)
            {
                if (Vragen.ContainsKey(CurrentIndex - 1))
                {
                    CurrentVraag = Vragen[CurrentIndex - 1];
                    CurrentIndex--;
                }
                else
                {
                    int y = 120;
                    MessageBox.Show("Geen vorige vraag gevonden (?)");

                }

                txtVraag.Text = CurrentVraag.txtVraag;
                txtAntwoord.Text = CurrentVraag.txtAntwoord;
            }
        }