Esempio n. 1
0
        private void OpenDataStore()
        {
            try
            {
                if (string.IsNullOrEmpty(Path) || string.IsNullOrEmpty(pwdBox.Password))
                {
                    throw new Exception("A path and password are required.");
                }
                else if (!Path.EndsWith(Extension))
                {
                    Path += Extension;
                }

                IDataStore ds = new SQLiteDataStore(Path, pwdBox.Password);
                ds.Open();

                DataStore = ds;

                pathHistory.AddItem(Path);
                settings.History = pathHistory.SerializeToString();
                settings.Save();

                Cancelled = false;
                openDatabaseWindow.Close();
            }
            catch (Exception e)
            {
                MessageBoxFactory.ShowError(e);
            }
        }