// --------------------- Functionality --------------------- /// <summary> /// Connect to the DB /// </summary> /// <author>Moritz Eversmann, Bernd Nottbeck</author> /// <param name="conParams"></param> /// <returns></returns> public bool ConnectToDb(ConnectionParameters conParams) { Cursor = Cursors.Wait; Boolean connected = DBConnectionHelpers.EstablishDatabaseConnection(conParams); Cursor = Cursors.Arrow; return(connected); }
/// <summary> /// handle Shortcuts /// </summary> /// <param Name="sender"></param> /// <param Name="e"></param> /// <author>Thomas Meents, Bernd Nottbeck, Jannik Arndt</author> private void HandleShortcuts(object sender, KeyEventArgs e) { if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { switch (e.Key) { case Key.R: Cursor = Cursors.Wait; try { DBConnectionHelpers.LoadConnectionParameters(); DBConnectionHelpers.EstablishDatabaseConnection(DBConnectionHelpers.LoadLastUsedDatabase()); } finally { Cursor = Cursors.Arrow; } break; } } else { switch (e.Key) { case Key.Enter: switch (ContentSource.ToString()) { case ("/Pages/P1connection.xaml"): ContentSource = new Uri("/Pages/P2metadata.xaml", UriKind.RelativeOrAbsolute); break; case ("/Pages/P2metadata.xaml"): ContentSource = new Uri("/Pages/P3dimensionselection.xaml", UriKind.RelativeOrAbsolute); break; case ("/Pages/P3dimensionselection.xaml"): ContentSource = new Uri("/Pages/P4eventselection.xaml", UriKind.RelativeOrAbsolute); break; case ("/Pages/P4eventselection.xaml"): ContentSource = new Uri("/Pages/P5configuration.xaml", UriKind.RelativeOrAbsolute); break; case ("/Pages/P5configuration.xaml"): if (MinerSettings.IsAlgorithmSet) { ContentSource = new Uri("/Pages/P6mining.xaml", UriKind.RelativeOrAbsolute); } break; case ("/Pages/P6mining.xaml"): // Start / Continue break; case ("/Pages/P7consolidation.xaml"): ContentSource = new Uri("/Pages/P8results.xaml", UriKind.RelativeOrAbsolute); break; } break; case Key.F11: if (WindowState.Equals(WindowState.Maximized)) { ViewRegularscreen(); } else { ViewFullscreen(); } break; } } }
public void EstablishDatabaseConnectionTest() { DBConnectionHelpers.EstablishDatabaseConnection(ConParams); Assert.IsNotNull(DBWorker.MetaData); }