コード例 #1
0
 public static void InitializeConnections(DatabaseType db)
 {
     if (db == DatabaseType.Sql)
     {
         SQLConnector sql = new SQLConnector();
         Connection = sql;
     }
     else if (db == DatabaseType.TextFile)
     {
         TextConnector text = new TextConnector();
         Connection = text;
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes connection for each of available connections
 /// </summary>
 /// <param name="database">Defines if sql database connection should be established</param>
 /// <param name="textFiles">Defines if textFile connection should be established</param>
 public static void InitializeConnections(bool database, bool textFiles)
 {
     if (database)
     {
         //TODO - Set up the SQL Connector properly
         SQLConnector sql = new SQLConnector();
         Connections.Add(sql);
     }
     if (textFiles)
     {
         TextConnector text = new TextConnector();
         Connections.Add(text);
         //TODO - Create the Text Connection
     }
 }
コード例 #3
0
        /// <summary>
        /// Initializes connection for each of available connections
        /// </summary>
        /// <param name="database">Defines if sql database connection should be established</param>
        /// <param name="textFiles">Defines if textFile connection should be established</param>
        public static void InitializeConnections(DatabaseType db)
        {
            switch (db)
            {
            case DatabaseType.Sql:
                SQLConnector sql = new SQLConnector();
                Connection = sql;
                break;

            case DatabaseType.TextFile:
                TextConnector text = new TextConnector();
                Connection = text;
                break;

            default:
                break;
            }
        }