public LastFmCurrentSongPublisher(
     IApplicationStateService stateService,
     ILastfmWebService webService)
 {
     this.stateService = stateService;
     this.webService   = webService;
 }
Exemple #2
0
        public AccountsViewPresenter(
            IApplicationResources resources,
            IGoogleAccountService googleAccountService,
            IGoogleMusicSessionService sessionService,
            ILastfmWebService lastfmWebService,
            ICurrentSongPublisherService publisherService,
            IApplicationSettingViewsService applicationSettingViewsService,
            INavigationService navigationService)
        {
            this.resources                      = resources;
            this.googleAccountService           = googleAccountService;
            this.sessionService                 = sessionService;
            this.lastfmWebService               = lastfmWebService;
            this.publisherService               = publisherService;
            this.applicationSettingViewsService = applicationSettingViewsService;
            this.navigationService              = navigationService;
            this.BindingModel                   = new AccountViewBindingModel();
            this.ForgetAccountCommand           = new DelegateCommand(this.ForgetAccount);
            this.SignOutCommand                 = new DelegateCommand(this.SignOutAccount);
            this.LastfmUnlinkCommand            = new DelegateCommand(this.LastfmUnlink);
            this.LastfmLinkCommand              = new DelegateCommand(this.LastfmLink, () => this.sessionService.GetSession().IsAuthenticated);
            this.ReloadSongsCommand             = new DelegateCommand(this.ReloadSongs, () => this.navigationService.HasHistory());

            var userInfo = this.googleAccountService.GetUserInfo();

            if (userInfo != null)
            {
                this.BindingModel.AccountName  = userInfo.Email;
                this.BindingModel.IsRemembered = userInfo.RememberAccount;
            }

            Session lastfmSession = this.lastfmWebService.GetSession();

            if (lastfmSession != null)
            {
                this.BindingModel.LastfmAccountName = lastfmSession.Name;
            }

            this.BindingModel.HasSession = this.sessionService.GetSession().IsAuthenticated;
        }
Exemple #3
0
 public LastfmAccountWebService(ILastfmWebService webService)
 {
     this.webService = webService;
 }