Exemple #1
0
        private SchedulerCenter GetScheduler()
        {
            string dbProviderName   = Configuration.GetSection("Quartz")["dbProviderName"];
            string connectionString = Configuration.GetSection("Quartz")["connectionString"];

            string driverDelegateType = string.Empty;

            switch (dbProviderName)
            {
            case "SQLite-Microsoft":
            case "SQLite":
                driverDelegateType = typeof(SQLiteDelegate).AssemblyQualifiedName; break;

            case "MySql":
                driverDelegateType = typeof(MySQLDelegate).AssemblyQualifiedName; break;

            case "OracleODPManaged":
                driverDelegateType = typeof(OracleDelegate).AssemblyQualifiedName; break;

            case "SQLServer":
            case "SQLServerMOT":
                driverDelegateType = typeof(SqlServerDelegate).AssemblyQualifiedName; break;

            case "Npgsql":
                driverDelegateType = typeof(PostgreSQLDelegate).AssemblyQualifiedName; break;

            case "Firebird":
                driverDelegateType = typeof(FirebirdDelegate).AssemblyQualifiedName; break;

            default:
                throw new System.Exception("dbProviderName unreasonable");
            }

            SchedulerCenter schedulerCenter = SchedulerCenter.Instance;

            schedulerCenter.Setting(new DbProvider(dbProviderName, connectionString), driverDelegateType);

            return(schedulerCenter);
        }
Exemple #2
0
 static SchedulerCenter()
 {
     Instance = new SchedulerCenter();
 }