private void InitSqlServerSettingsSource()
 {
     UIHelper.PerformLongOperation("Collecting information",
                                   () => SqlServerSettingsList = SqlConnectionInfoFactory.GetSqlServerSettingsList());
     _sqlServerSettingsListInitialized = true;
     DatabaseProvidersSource           = SqlServerSettingsList;
     if (Settings == null)
     {
         return;
     }
     DatabaseProvider = Settings.DatabaseType == (decimal)SqlConnectionInfo.DbType.Server
         ? DatabaseProvidersSource.FirstOrDefault(p => p.Version == Settings.ProviderVersion)
         : DatabaseProvidersSource.FirstOrDefault();
 }
        private void SetDatabaseProvider(DatabaseSettings settings)
        {
            var databaseProvider = settings == null || DatabaseProvidersSource == null
                                    ? null
                                    : DatabaseProvidersSource.FirstOrDefault(i => i.Version == settings.ProviderVersion);

            if (databaseProvider != null && DatabaseProvidersSource == null)
            {
                DatabaseProvidersSource = new List <SqlConnectionInfo> {
                    databaseProvider
                };
            }
            DatabaseProvider = databaseProvider;
        }