public MainWindow(string activityInformations, ref Teacher teacher) : this() { activity = ActivityPathParser.Parser(activityInformations); this.teacher = teacher; if (activity.IDActivity != -2) { BDDAccess bddAccess = new BDDAccess(); if (bddAccess.Connect()) { activity = bddAccess.GetActivity(activity.IDActivity); activity.ProvidedWords = activity.ProvidedWords.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList(); TexteTextBox.DataContext = activity; ProvidedWordsListBox.ItemsSource = activity.ProvidedWords; if (!string.IsNullOrEmpty(bddAccess.Information)) { MessageBox.Show(bddAccess.Information, new AssemblyInformations(Assembly.GetExecutingAssembly().GetName().Name).Product, MessageBoxButton.OK, bddAccess.MessageBoxImage, MessageBoxResult.OK); } } } }
private void OpenFileHyperLink_Click(object sender, RoutedEventArgs e) { Hyperlink hyperlink = sender as Hyperlink; OpenFileDialog openFileDialog = new OpenFileDialog() { Filter = "Fichier Studio des Langues Professeur|*.sdlp|Fichier Studio des Langues Elèves|*.sdle" }; if (hyperlink.Tag as string == "Result") { openFileDialog.FilterIndex = 2; } if ((bool)openFileDialog.ShowDialog()) { Hide(); if (Path.GetExtension(openFileDialog.FileName) == ".sdlp") { new MainWindow(ActivityPathParser.ParserInvert(openFileDialog.FileName), ref teacher).ShowDialog(); } else if (Path.GetExtension(openFileDialog.FileName) == ".sdle") { ActivityResult activityResult = ActivityResult.Open(openFileDialog.FileName); new ResultViewer(activityResult).ShowDialog(); } if (!isClosed) { ShowDialog(); } } }
public MainWindow(string activityInformations) : this() { activity = ActivityPathParser.Parser(activityInformations); activity.ProvidedWords = activity.ProvidedWords.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList(); TexteTextBox.DataContext = activity; ProvidedWordsListBox.ItemsSource = activity.ProvidedWords; }
private void OpenCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { if (!Ldap.IsAuthificated) { new AuthentificationWindow(ref teacher).ShowDialog(this); } if (Ldap.IsAuthificated) { OpenBDDWindow openBDD = new OpenBDDWindow(teacher); openBDD.ShowDialog(this); if (openBDD.ActivityInformations != "" && openBDD.ActivityInformations != null) { activity = ActivityPathParser.Parser(openBDD.ActivityInformations); if (activity.IDActivity != -2) { BDDAccess bddAccess = new BDDAccess(); if (bddAccess.Connect()) { activity = bddAccess.GetActivity(activity.IDActivity); activity.ProvidedWords = activity.ProvidedWords.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList(); TexteTextBox.DataContext = activity; ProvidedWordsListBox.ItemsSource = activity.ProvidedWords; if (!string.IsNullOrEmpty(bddAccess.Information)) { MessageBox.Show(bddAccess.Information, new AssemblyInformations(Assembly.GetExecutingAssembly().GetName().Name).Product, MessageBoxButton.OK, bddAccess.MessageBoxImage, MessageBoxResult.OK); } } } } } }
private void OpenActivity() => ActivityInformations = ActivityPathParser.ParserInvert(activities[ActivitesListBox.SelectedIndex]);