Пример #1
0
        /// <summary>
        /// Have the driver cleanup after itself
        /// </summary>
        protected override void DriverDispose()
        {
            if (this.driver != null)
            {
                this.driver.Dispose();
            }

            this.driver = null;
        }
Пример #2
0
        /// <summary>
        /// Get the database driver
        /// </summary>
        /// <returns>The database driver</returns>
        public DatabaseDriver GetDatabaseDriver()
        {
            if (this.driver == null)
            {
                if (LoggingConfig.GetLoggingEnabledSetting() == LoggingEnabled.NO)
                {
                    this.Log.LogMessage(MessageType.INFORMATION, "Getting database driver");
                    this.driver = new DatabaseDriver(GetBase() as IDbConnection);
                }
                else
                {
                    this.Log.LogMessage(MessageType.INFORMATION, "Getting event firing database driver");
                    this.driver = new EventFiringDatabaseDriver(GetBase() as IDbConnection);
                    this.MapEvents(this.driver as EventFiringDatabaseDriver);
                }
            }

            return(this.driver);
        }
Пример #3
0
 /// <summary>
 /// Override the database connection driver
 /// </summary>
 /// <param name="driver">New database connection driver</param>
 public void OverrideDatabaseDriver(DatabaseDriver driver)
 {
     this.DatabaseManager.OverwriteDriver(driver);
 }
Пример #4
0
 /// <summary>
 /// Override the email driver - respects lazy loading
 /// </summary>
 /// <param name="overrideDriver">Function for getting new database connection</param>
 public void OverrideDriver(Func <IDbConnection> overrideDriver)
 {
     this.driver = null;
     this.OverrideDriverGet(overrideDriver);
 }
Пример #5
0
 /// <summary>
 /// Override the database driver
 /// </summary>
 /// <param name="newDriver">The new driver</param>
 public void OverrideDriver(DatabaseDriver newDriver)
 {
     this.driver     = newDriver;
     this.BaseDriver = newDriver.Connection;
 }
Пример #6
0
 /// <summary>
 /// Override the database driver
 /// </summary>
 /// <param name="newDriver">The new driver</param>
 public void OverwriteDriver(DatabaseDriver newDriver)
 {
     this.driver = newDriver;
 }
Пример #7
0
 public void OverwriteDriver(DatabaseDriver newDriver)
 {
     this.OverrideDriver(newDriver);
 }