Exemple #1
0
        public static Database Open(string databasePath)
        {
            if (databasePath == null)
            {
                throw new ArgumentNullException(nameof(databasePath));
            }

            PeygirDatabaseDataSet.ChangeDatabasePath(databasePath);

            var result = new Database();

            InitializeDatabase(result, databasePath);
            Version.UpdateIfAppropriate(result);
            return(result);
        }
Exemple #2
0
        public void Flush()
        {
            if (!IsOpen)
            {
                throw new InvalidOperationException();
            }

            string databasePath = CurrentDatabasePath;

            // Reconnect.
            Close();

            PeygirDatabaseDataSet.ChangeDatabasePath(databasePath);
            InitializeDatabase(this, databasePath);
        }