/// <summary> /// Initializes a new instance of the <see cref="ExternalManagedDatabase"/> class. /// Creates a database that will be managed by the Database Manager. /// Make sure to set up the dependencies as explained for each parameter. /// </summary> /// <param name="dataProvider"> /// Needs to be connected to a server /// ParameterPlaceHolder needs to be set /// </param> /// <param name="dataProviderInfo"> /// External: MySql, Postgres etc. /// </param> public IManagedDatabase InitializeWith(IDataProvider dataProvider, IDataProviderInfo dataProviderInfo) { _dataProviderInfo = dataProviderInfo; DataProvider = dataProvider; return(this); }
public void _Init() { _stub = new StubBuilder(); _mockUserConfiguration = new MockUserConfiguration(); _mockSettings = new Settings(_mockUserConfiguration); _mySqlProvider = new MySqlInfo(); _sqLiteProvider = new SqLiteInfo(); }
public DataProviderInfoModel(IDataProviderInfo info) { if (info == null) { throw new ArgumentNullException(nameof(info)); } _info = info; }
public IDatabaseSettings SetServerConnectStringFor( IDataProviderInfo dataProviderInfo, string serverConnectString) { string key = ServerSettingsUtility.GetServerConnectKeyFor(dataProviderInfo); _settings.Set(key, serverConnectString); return(this); }
public FakeToponymDataProvider(IDataProviderInfo info) { if (info == null) { throw new ArgumentNullException(nameof(info)); } Info = info; }
public IDataProviderInfos Support(IDataProviderInfo dataProviderInfo) { if (!_supportedDataProviders.Contains(dataProviderInfo)) { _supportedDataProviders.Add(dataProviderInfo); } return(this); }
/// <summary> /// Obtains connection string for current provider from the settings /// </summary> /// <returns>connection string or null if cone was found</returns> public string GetConnectionStringFor(IDataProviderInfo dataProviderInfo) { if (ConnectionStringExistsFor(dataProviderInfo)) { return (_settings.ConnectionStrings[dataProviderInfo.FullName].ConnectionString.TrimEnd(';')); } return(null); }
public IManagedDatabase InitializeWith(IDataProvider dataProvider, IDataProviderInfo dataProviderInfo) { _dataProviderInfo = dataProviderInfo; DataProvider = dataProvider; _databaseDirectory = string.Format("{0}\\{1}\\", Files.LocalUserAppDataPath, Files.DataFolder); ValidateDatabaseDirectoryAndRecreateIfNeccessary(); return(this); }
public ConfigureMySqlDataProviderViewModel( IEventAggregator eventAggregator, IDatabaseSettings databaseSettings, IDatabaseConnector databaseConnector) : base(eventAggregator, databaseSettings, databaseConnector) { _dataProviderInfo = new MySqlInfo(); DetectMySqlAndSetMySqlVersionInfoAccordinly(); _pokerOfficeSettings = GetPokerofficeSettings(); Initialize(); }
public void Connect(string connString, IDataProviderInfo dataProviderInfo) { _dataProviderInfo = dataProviderInfo; _providerFactory = DbProviderFactories.GetFactory(dataProviderInfo.FullName); _connection = _providerFactory.CreateConnection(); _connection.ConnectionString = connString; _connection.Open(); DatabaseName = IsConnectedToDatabase ? Connection.Database : Resources.Status_NotConnectedToDatabase; }
public IDatabaseSettings SetConnectionStringFor(IDataProviderInfo dataProviderInfo, string connectionString) { if (!ConnectionStringExistsFor(dataProviderInfo)) { _settings.ConnectionStrings.Add( new ConnectionStringSettings(dataProviderInfo.FullName, connectionString)); } else { _settings.ConnectionStrings[dataProviderInfo.FullName].ConnectionString = connectionString; } _settings.Save(ConfigurationSaveMode.Minimal); return(this); }
public WeatherFromProviderInfo(IDataProviderInfo dataProviderInfo, IWeatherData weatherData) { DataProviderInfo = dataProviderInfo; WeatherData = weatherData; }
public IDatabaseSettings SetCurrentDataProviderTo(IDataProviderInfo dataProviderInfo) { _settings.Set(ServerSettings.ProviderName.ToString(), dataProviderInfo.FullName); return(this); }
public DataProviderInfoCashValue(IDataProviderInfo[] infoList) { if (infoList == null) throw new ArgumentNullException(nameof(infoList)); InfoListValue = infoList; TimeStamp = TimeProvider.Current.UtcNow; }
internal static string GetServerConnectKeyFor(IDataProviderInfo dataProviderInfo) { return(string.Format("{0}.{1}", dataProviderInfo.FullName, ServerSettings.ServerConnect)); }
public bool ConnectionStringExistsFor(IDataProviderInfo dataProviderInfo) { return(_settings.ConnectionStrings[dataProviderInfo.FullName] != null); }
public IDatabaseConnector InitializeWith(IDataProviderInfo dataProviderInfo) { _dataProviderInfo = dataProviderInfo; return(this); }
public IDatabaseConnector InitializeFromSettings() { IDataProviderInfo dataProviderInfo = _databaseSettings.GetCurrentDataProvider(); return(InitializeWith(dataProviderInfo)); }
/// <summary> /// Only applies to MySql and Postgres /// </summary> /// <returns> /// Gets the connection string that is necesary to connect /// to the server from the settings /// </returns> public string GetServerConnectStringFor(IDataProviderInfo dataProviderInfo) { string key = ServerSettingsUtility.GetServerConnectKeyFor(dataProviderInfo); return(_settings.RetrieveString(key)); }
public FakeWeatherDataProvider(IDataProviderInfo info) { if (info == null) throw new ArgumentNullException(nameof(info)); Info = info; }
public bool ProviderIsAvailable(IDataProviderInfo dataProviderInfo) { return(GetAvailableProviders().Any(dp => dp.FullName.Equals(dataProviderInfo.FullName))); }