private void Button_Click(object sender, RoutedEventArgs e) { switch ((string)Escape.Content) { case "Назад": if (TextGetter.Text == task.password) { Window9 w = new Window9(task); w.Show(); Close(); } else { Erorr.Text = "Неверный ключ"; } break; case "Пропустить": if (TextGetter.Text == "") { Erorr.Text = "Пустой ключ"; } else { Window6 w = new Window6(name, author, qestionsAll, TextGetter.Text); w.Show(); Close(); } break; } }
private void Button_Click_4(object sender, RoutedEventArgs e) { try { stream.Dispose(); } catch { } try { oldTask.answers.RemoveAt(qestionNumber - 1); oldTask.V1.RemoveAt(qestionNumber - 1); oldTask.V2.RemoveAt(qestionNumber - 1); oldTask.V3.RemoveAt(qestionNumber - 1); oldTask.V4.RemoveAt(qestionNumber - 1); oldTask.qestion.RemoveAt(qestionNumber - 1); oldTask.pictures.RemoveAt(qestionNumber - 1); } catch { } oldTask.qestions = Convert.ToString(int.Parse(qestionsAll) - 1); tasks.qestions = Convert.ToString(int.Parse(qestionsAll) - 1); qestionNumber--; qestionsAll = Convert.ToString(int.Parse(qestionsAll) - 1); if (this.qestionNumber == int.Parse(this.qestionsAll)) { Ending(); } else { Window9 w = new Window9(tasks, oldTask, qestionNumber); w.Show(); Close(); } }
private void Window8_Loaded(object sender, RoutedEventArgs e) { if (task.password == "") { Window9 w = new Window9(task); w.Show(); Close(); } }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (corect == 0) { if (V1.Text != "" && V2.Text != "" && V3.Text != "" && V4.Text != "" && task.Text != "" && (v1.IsChecked == true || v3.IsChecked == true || (v2.IsChecked == true) || v4.IsChecked == true)) { if (v1.IsChecked == true) { tasks.answers.Add(V1.Text); } else if (v2.IsChecked == true) { tasks.answers.Add(V2.Text); } else if (v3.IsChecked == true) { tasks.answers.Add(V3.Text); } else if (v4.IsChecked == true) { tasks.answers.Add(V4.Text); } tasks.V1.Add(V1.Text); tasks.V2.Add(V2.Text); tasks.V3.Add(V3.Text); tasks.V4.Add(V4.Text); tasks.qestion.Add(task.Text); try { stream.Dispose(); } catch { } try { FileInfo f = new FileInfo(fd.FileName); DirectoryInfo dir = new DirectoryInfo(System.AppDomain.CurrentDomain.BaseDirectory + "Data\\" + tasks.name); try { f.CopyTo(AppDomain.CurrentDomain.BaseDirectory + "Data\\" + tasks.name + "\\" + qestionNumber + f.Extension, true); } catch { dir.Create(); f.CopyTo(System.AppDomain.CurrentDomain.BaseDirectory + "Data\\" + tasks.name + "\\" + qestionNumber + f.Extension, true); } tasks.pictures.Add(String.Format("\\Data\\" + tasks.name + "\\" + qestionNumber + f.Extension)); } catch { tasks.pictures.Add(""); } if (this.qestionNumber == int.Parse(this.qestionsAll)) { Ending(); } else { Window9 w = new Window9(tasks, oldTask, qestionNumber); w.Show(); Close(); } } else { if (v1.IsChecked == false && v3.IsChecked == false && v2.IsChecked == false && v4.IsChecked == false) { choose.Text = "Выбирете правильный вар. ответа!"; } if (task.Text == "") { task.Background = Brushes.OrangeRed; } if (V1.Text == "") { V1.Background = Brushes.OrangeRed; } if (V2.Text == "") { V2.Background = Brushes.OrangeRed; } if (V3.Text == "") { V3.Background = Brushes.OrangeRed; } if (V4.Text == "") { V4.Background = Brushes.OrangeRed; } } } }