Exemplo n.º 1
0
 public BaseData()
 {
     _Connection = null;
     _DBPath = String.Empty;
     _ConnectionString = String.Empty;
     _fileHelpers = new FileHelpers();
 }
Exemplo n.º 2
0
 public AppManager()
 {
     _SettingsDB = new SettingsManager("settings.dbm");
     _translator = new TranslationsHelpers(_SettingsDB.LoadMessagesTranslations(), _SettingsDB.LoadComponentsTranslations());
     _AppSettings = _SettingsDB.LoadSettings();
     _recentDBs = _SettingsDB.LoadRecentDatabases();
     _DB = new Database();
     _DosBoxHelper = new DOSBoxHelpers();
     _fileHelper = new FileHelpers();
 }
Exemplo n.º 3
0
        public BaseData(String DBPath)
        {
            _Connection = null;
            _DBPath = DBPath;
            _ConnectionString = String.Format("Data Source={0};Version=3;", DBPath);
            _fileHelpers = new FileHelpers();

            //Connection
            _Connection = new SQLiteConnection(_ConnectionString);
            _Connection.Open();
        }
Exemplo n.º 4
0
        public void Dispose()
        {
            _recentDBs = null;
            _translator = null;
            _AppSettings = null;
            _DosBoxHelper = null;
            _fileHelper = null;

            if(_DB != null && _DB.ConnectionStatus == System.Data.ConnectionState.Open)
                _DB.Disconnect();
            _DB = null;

            if (_SettingsDB != null && _SettingsDB.ConnectionStatus == System.Data.ConnectionState.Open)
                _SettingsDB.Disconnect();
            _SettingsDB = null;
        }