Some refactorings
This commit is contained in:
@ -8,23 +8,27 @@ namespace TrackerLibrary
|
||||
{
|
||||
public static class GlobalConfig
|
||||
{
|
||||
public static List<IDataConnection> Connections { get; private set; } = new List<IDataConnection>();
|
||||
public static void InitializeConnections(bool database, bool textFiles)
|
||||
public static IDataConnection Connection { get; private set; }
|
||||
public static void InitializeConnections(DatabaseType db)
|
||||
{
|
||||
if (database)
|
||||
|
||||
switch (db)
|
||||
{
|
||||
// TODO - Set up the sql connector properly !
|
||||
SqlConnector sql = new SqlConnector();
|
||||
Connections.Add(sql);
|
||||
}
|
||||
|
||||
if (textFiles)
|
||||
{
|
||||
// TODO - Create the text Connection
|
||||
TextConnector text = new TextConnector();
|
||||
Connections.Add(text);
|
||||
case DatabaseType.Sql:
|
||||
// TODO - Set up the sql connector properly !
|
||||
SqlConnector sql = new SqlConnector();
|
||||
Connection = sql;
|
||||
break;
|
||||
case DatabaseType.TextFile:
|
||||
// TODO - Create the text Connection
|
||||
TextConnector text = new TextConnector();
|
||||
Connection = text;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static string CnnString(string name)
|
||||
|
||||
Reference in New Issue
Block a user