Exemplo n.º 1
0
 //Card Management
 private void AddCard(string Q, string A, string N)
 {
     cardIndex +=1;
     Card myNewCard = new Card();
     enableDisplay();
     myNewCard.New(Q, A, N, cardIndex);
     currentStack.Add(myNewCard);
     cardDisplayListBox.Items.Add("Card " + currentStack.Count);
 }
Exemplo n.º 2
0
        private void displayNewCard(Card cardToDisplay)
        {
            questionLB.Text = cardToDisplay.Q;
            answerLB.Text = cardToDisplay.A;
            notesLB.Text = cardToDisplay.N;

            speechGenerator.Speak("question: " + cardToDisplay.Q,SpeechVoiceSpeakFlags.SVSFlagsAsync);

            userInputTB.Text = ""; //clear the input, so that people can easily enter text.
            userInputTB.Focus(); //put cursor in here, so that the next answer can be easily entered.
            userInputTB.Enabled = true;

            antiCheatingMethodReveal();
        }
Exemplo n.º 3
0
        private void openStackFromFile(string fileName)
        {
            System.IO.StreamReader reader = null;
            currentStack.Clear(); //ensure that the card list is empty, so that we can proceed
            cardDisplayListBox.Items.Clear(); //also clear the user display.

            try
                {
            reader = new System.IO.StreamReader(fileName);

                 titleOfStack = reader.ReadLine();
                 stackTitle.Text = titleOfStack;
                 int i = 0;
                 do
                 {
                     Card cardToAdd = new Card();
                     string line = reader.ReadLine();
                     string[] A = line.Split(delimiter);
                     cardToAdd.Q = A[0];
                     cardToAdd.A = A[1];
                     cardToAdd.N = A[2];
                     cardToAdd.score = int.Parse(A[3]);
                     cardToAdd.index = i;
                     currentStack.Add(cardToAdd);
                     cardDisplayListBox.Items.Add(cardToAdd.Q);
                     i += 1;
                 } while (reader.EndOfStream == false);
            }
            catch (Exception)
            {

            MessageBox.Show("Error!");
            }
            finally
            {

                if (reader != null)
                {
                    reader.Close();

                }

            }
        }
Exemplo n.º 4
0
 private void displayCard(Card cardToDisplay)
 {
     qnTB.Text = cardToDisplay.Q;
     anTB.Text = cardToDisplay.A;
     ntTB.Text = cardToDisplay.N;
 }