/// <summary>
        /// Add a new connection to the DatabaseSettings.xml and connect to the Database
        /// </summary>
        /// <author>Bernhard Bruns</author>
        private void SaveAndConnectClick(object sender, RoutedEventArgs e)
        {
            DBConnectionHelpers.LoadConnectionParameters();

            ConnectionParameters connectionParameters = new ConnectionParameters(DBTypeComboBox.Text, DBConnectionnameTextBox.Text, DBHostnameTextBox.Text, DBDatabaseTextBox.Text, DBUsernameTextBox.Text, DBPasswordTextBox.Password, DBPortTextBox.Text);

            if (connectionParameters.IsComplete())
            {
                if (DBConnectionHelpers.CheckIfDatabaseNameExists(connectionParameters.Name))
                {
                    DBConnectionHelpers.AddDatabaseConnectionToConnectionList(connectionParameters);

                    if (ConnectToDb(connectionParameters))
                    {
                        DBConnectionHelpers.SaveConnectionParameters();
                        DBConnectionHelpers.SaveLastUsedDatabase(connectionParameters);
                        AddConnectionGrid.Visibility = Visibility.Collapsed;
                    }
                    else
                    {
                        ModernDialog.ShowMessage("Can't connect to database!", "New Connection", MessageBoxButton.OK);
                    }
                }
                else
                {
                    ModernDialog.ShowMessage("Connection Name \"" + connectionParameters.Name + "\" already exists! \r\nPlease choose a new Name for your connection.", "New Connection", MessageBoxButton.OK);
                }
            }
            else
            {
                ModernDialog.ShowMessage("Please fill out all fields to add the new connection!", "New Connection", MessageBoxButton.OK);
            }
        }
        /// <summary>
        /// Adds a new/changed connection to the connection list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddConnectionClick(object sender, RoutedEventArgs e)
        {
            ConnectionParameters conParams = new ConnectionParameters(DBTypeComboBox.Text, DBConnectionnameTextBox.Text, DBHostnameTextBox.Text, DBDatabaseTextBox.Text, DBUsernameTextBox.Text, DBPasswordPasswordBox.Password, DBPortTextBox.Text);

            if (conParams.IsComplete())
            {
                if (DBConnectionHelpers.CheckIfDatabaseNameExists(conParams.Name))
                {
                    DBConnectionHelpers.AddDatabaseConnectionToConnectionList(conParams);
                }

                else
                {
                    if (ModernDialog.ShowMessage("Connection Name \"" + conParams.Name + "\" already exists! \r\nDo you want to override the existing connection?", "New Connection", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        DBConnectionHelpers.RemoveConnectionParameter(conParams.Name);
                        DBConnectionHelpers.AddDatabaseConnectionToConnectionList(conParams);
                    }
                }
            }
            else
            {
                ModernDialog.ShowMessage("Please fill out all fields to add the new connection!", "New Connection", MessageBoxButton.OK);
            }

            ReloadListbox();
        }
        public void CheckIfDBNameAlreadyExistsTest2()
        {
            ConnectionParameters connectionParams = new ConnectionParameters("TestString", "Cname", "TestString", "TestString", "TestString", "TestString", "TestString");
            string connectionName = "OtherName";

            DBConnectionHelpers.ConnectionParametersList = new List <ConnectionParameters>();
            DBConnectionHelpers.ConnectionParametersList.Add(connectionParams);

            bool actual = DBConnectionHelpers.CheckIfDatabaseNameExists(connectionName);

            Assert.IsTrue(actual);
        }