Ejemplo n.º 1
0
        public void InitLocal(IDBCreator creator)
        {
            if (!File.Exists(m_UserSettingsService.DBPath))
            {
                SQLiteConnection.CreateFile(m_UserSettingsService.DBPath);
            }

            m_dbConnection = new SQLiteConnection($"Data Source={m_UserSettingsService.DBPath};Version=3;New=False;");
            creator.Create(this);
        }
Ejemplo n.º 2
0
        public void InitLocal(IDBCreator creator, IDBUpdater updater)
        {
            if (!File.Exists(m_UserSettingsService.DBPath))
            {
                // Does an old beta file exist?
                if (File.Exists(m_UserSettingsService.DBPathBeta))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(m_UserSettingsService.DBPath));
                    File.Copy(m_UserSettingsService.DBPathBeta, m_UserSettingsService.DBPath);
                }
                else
                {
                    // Nope, we are fresh
                    SQLiteConnection.CreateFile(m_UserSettingsService.DBPath);
                }
            }

            m_dbConnection = new SQLiteConnection($"Data Source={m_UserSettingsService.DBPath};Version=3;New=False;");
            m_Command      = new SQLiteCommand(m_dbConnection);
            creator.Create(this);
            updater.Upgrade(this);
        }