예제 #1
0
        protected void buildDatabaseObject(string fName, bool setupDB = false)
        {
            var m = this.database = new TemplatesDatabase(fName, setupDB);

            m.ConnectionClosed += delegate { this.database_onConnectionClosed(); };
            m.ChangesSaved     += delegate { this.database_onChangesSaved(); };
            database_onConnectionOpened(); // call internal "event"
        }
예제 #2
0
        /// <summary>
        /// Closes database file (notifies database) and updates status bar
        /// </summary>
        protected void CloseDatabaseFile()
        {
            if (this.database == null)
            {
                return;
            }
            var db = this.database;

            this.database = null;
            db.CloseConnection();
            this.settings.DatabasePath = "";
        }