private void setDatabases(IDatabaseConnector dbConnector)
        {
            if (dbConnector != null)
            {
                try
                {
                    databaseNames = dbConnector.GetDatabaseNames();
                }
                catch (SqlException e)
                {
                    databaseNames = new List <string>();
                    MessageBox.Show(e.Message, "SqlException", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            else
            {
                databaseNames = new List <string>();
            }

            if (databaseNames.Count > 0 && dbConnector.GetDatabaseNames().Contains(selectedDatabase.Name))
            {
                SelectedDatabase = dbConnector.GetDatabase(selectedDatabase.Name);
            }
            else if (databaseNames.Count > 0)
            {
                SelectedDatabase = dbConnector.GetDatabase(databaseNames[0]);
            }
            else
            {
                SelectedDatabase = null;
            }

            NotifyPropertyChanged("DatabaseNames");
        }
        private void setDatabases(IDatabaseConnector dbConnector)
        {
            if (dbConnector != null)
            {
                try
                {
                    databaseNames = dbConnector.GetDatabaseNames();
                }
                catch (SqlException e)
                {
                    databaseNames = new List<string>();
                    MessageBox.Show(e.Message, "SqlException", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            else
            {
                databaseNames = new List<string>();
            }

            if (databaseNames.Count > 0 && dbConnector.GetDatabaseNames().Contains(selectedDatabase.Name))
            {
                SelectedDatabase = dbConnector.GetDatabase(selectedDatabase.Name);
            }
            else if (databaseNames.Count > 0)
            {
                SelectedDatabase = dbConnector.GetDatabase(databaseNames[0]);
            }
            else
            {
                SelectedDatabase = null;
            }

            NotifyPropertyChanged("DatabaseNames");
        }