Exemplo n.º 1
0
        private void FileModeConfirmed(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog FileDialog = new Microsoft.Win32.OpenFileDialog();
            FileDialog.Filter = RandotronWPF.Properties.Resources.FileModeFilter;
            FileStream fs;

            if (FileDialog.ShowDialog() == true)
            {
                StudentNameList.Clear();
                fs = new FileStream(FileDialog.FileName, System.IO.FileMode.Open, FileAccess.Read);
                using (StreamReader sr = new StreamReader(fs, Encoding.UTF8))
                {
                    StudentCount = 0;
                    while (sr.Peek() > 0)
                    {
                        StudentCount++;
                        string StuName = sr.ReadLine();
                        StudentNameList.Add(StuName);
                    }
                }
                ClearAndShow();
                UpdateText(CurrentStudent);
                StuNameConfirmed = true;
                RolltoRight(true);
                FocusBox.Focus();
            }
        }
Exemplo n.º 2
0
        private void NumberModeConfirmed(object sender, RoutedEventArgs e)
        {
            int Tnumber = GetStudentNumber(NumberTextBox);

            if (Tnumber <= 0)
            {
                PopUp(RandotronWPF.Properties.Resources.InvalidNumber); return;
            }
            if (Tnumber > MAXS)
            {
                PopUp(RandotronWPF.Properties.Resources.HugeNumber); return;
            }
            NumberTextBox.Text = Tnumber.ToString();
            StudentCount       = Tnumber;
            ClearAndShow();
            UpdateText(CurrentStudent);
            StuNumConfirmed = true;
            RolltoRight(true);
            FocusBox.Focus();
        }
Exemplo n.º 3
0
 private void FileModeConfirmed(object sender, RoutedEventArgs e)
 {
     Microsoft.Win32.OpenFileDialog FileDialog = new Microsoft.Win32.OpenFileDialog();
     FileDialog.Filter      = RandotronWPF.Properties.Resources.PhotoModeFilter;
     FileDialog.Multiselect = true;
     if (FileDialog.ShowDialog() == true)
     {
         StudentPhotoList.Clear();
         string[] files = null;
         files        = FileDialog.FileNames;
         StudentCount = 0;
         for (int i = 0; i < files.Length; ++i)
         {
             StudentCount++;
             string StuPhoto = files[i];
             StudentPhotoList.Add(StuPhoto);
         }
         ClearAndShow();
         UpdatePhoto(CurrentStudent);
         StuPhotoConfirmed = true;
         RolltoRight(true);
         FocusBox.Focus();
     }
 }
Exemplo n.º 4
0
 private void PopUpBarConfirmed(object sender, RoutedEventArgs e)
 {
     PopUpBar.IsActive = false; FocusBox.Focus();
 }
Exemplo n.º 5
0
 private void NxtBtnClicked(object sender, RoutedEventArgs e)
 {
     RolltoRight(false); FocusBox.Focus();
 }
Exemplo n.º 6
0
 // Functions
 private void PreBtnClicked(object sender, RoutedEventArgs e)
 {
     RolltoLeft(); FocusBox.Focus();
 }