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); } } } }
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); } } } } } }