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 Escape_Click(object sender, RoutedEventArgs e) { switch ((string)Escape.Content) { case "Назад": Window1 w = new Window1(); w.Show(); Close(); break; case "Пропустить": Window6 w6 = new Window6(name, author, qestionsAll, ""); w6.Show(); Close(); break; } }
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) { answers.Add(V1.Text); } else if (v2.IsChecked == true) { answers.Add(V2.Text); } else if (v3.IsChecked == true) { answers.Add(V3.Text); } else if (v4.IsChecked == true) { answers.Add(V4.Text); } lV1.Add(V1.Text); lV2.Add(V2.Text); lV3.Add(V3.Text); lV4.Add(V4.Text); tasks.Add(task.Text); try { stream.Dispose(); } catch { } try { FileInfo f = new FileInfo(fd.FileName); DirectoryInfo dir = new DirectoryInfo(System.AppDomain.CurrentDomain.BaseDirectory + "\\Data\\" + name); try { f.CopyTo(System.AppDomain.CurrentDomain.BaseDirectory + "\\Data\\" + name + "\\" + qestionNumber + f.Extension); } catch { dir.Create(); f.CopyTo(System.AppDomain.CurrentDomain.BaseDirectory + "\\Data\\" + name + "\\" + qestionNumber + f.Extension); } pictures.Add(String.Format("\\Data\\" + name + "\\" + qestionNumber + f.Extension)); } catch { pictures.Add(""); } if (this.qestionNumber == int.Parse(this.qestionsAll)) { Ending(); } else { Window6 w = new Window6(name, author, qestionsAll, tasks, answers, pictures, qestionNumber, password, lV1, lV2, lV3, lV4); 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; } } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Window = ((Test.Window6)(target)); return; case 2: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 3: #line 58 "..\..\..\Window6.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 4: #line 59 "..\..\..\Window6.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_1); #line default #line hidden return; } this._contentLoaded = true; }