Example #1
0
        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());
            }
        }
Example #2
0
        public PieceRandomiser()
        {
            this.random = new Random(DateTime.Now.Second);
            var folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            this.dropboxAccess = new DropboxAccess(folderPath);
            this.GetGlassPieces();
        }
Example #3
0
        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();
        }
Example #4
0
 public DropboxLoggerService()
 {
     this.dropboxAccess = new DropboxAccess();
 }