private void OnSuccess(string accessToken) { var dropboxAccess = _database.GetSingleByName <DropboxAccess>(DropboxAccess.ObjectName); if (dropboxAccess == null) { var dbAccess = new DropboxAccess { AccessToken = _dropboxService.GetAccessToken() }; _logger.Info("insert dropbox access token"); _database.Insert(dbAccess); _messenger.Send(new DropboxAccessTokenSavedMsg()); } else { _logger.Info("update dropbox access token"); dropboxAccess.AccessToken = _dropboxService.GetAccessToken(); _database.Update(dropboxAccess); _messenger.Send(new DropboxAccessTokenSavedMsg()); } }
public PieceRandomiser() { this.random = new Random(DateTime.Now.Second); var folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); this.dropboxAccess = new DropboxAccess(folderPath); this.GetGlassPieces(); }
public PracticeDataViewModel() { var databaseName = this.DefaultDatabaseName(); var folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); this.DatabasePath = Path.Combine(folderPath, databaseName); this.dropboxAccess = new DropboxAccess(folderPath); this.PracticeItemDataStore = new PracticeItemDataStore(this.DatabasePath); this.RefreshPracticeItems(); this.logger = new DropboxLoggerService(); }
public DropboxLoggerService() { this.dropboxAccess = new DropboxAccess(); }