Пример #1
0
        public async Task AddToQueue(ContentItemEx item)
        {
            Mark mark = MarkManager.GetMark();

            if (mark.HasFlag(Mark.Hulu) || mark.HasFlag(Mark.Netflix))
            {
                await Application.Current.MainPage.DisplayAlert("Error", "We're sorry but there is currently an issue with the PlayOn Cloud service. Please try again later.", "OK");

                return;
            }

            if (!SharedSettingsService.Instance.GetBoolValue("IsLegalDisclaimerAccepted"))
            {
                if (await MessagingCenterManager.ShowPopup(new LegalDisclaimer()))
                {
                    SharedSettingsService.Instance.SetBoolValue("IsLegalDisclaimerAccepted", true);
                }
                else
                {
                    return;
                }
            }

            if (await addToQueue(item))
            {
                await Update();
            }
            else
            {
                await Application.Current.MainPage.DisplayAlert("Queue Error", "There was an error queueing the video for recording.", "OK");
            }

            await accountViewModel.FetchUserCreditsAsync();
        }
Пример #2
0
 public Account()
 {
     SubmitSupportRequest = new Command <LibraryItem>(async p => await submitSupportRequest(p));
     ChannelLogout        =
         new Command <IContentItem>(async parameter => await mediaContentViewModel.PerformChannelLogout(parameter));
     PullUserCreditsAsync = new Command(async() => await FetchUserCreditsAsync());
     ChannelLoginHelp     =
         new Command <IContentItem>(
             parameter =>
             MessagingCenterManager.ShowPopup(new ChannelLoginHelp {
         BindingContext = mediaContentViewModel
     }));
 }
        public MediaContent(Queue queueViewModel, Account accountViewModel, Products productsViewModel)
        {
            this.queueViewModel    = queueViewModel;
            this.accountViewModel  = accountViewModel;
            this.productsViewModel = productsViewModel;

            breadcrumbs = new ObservableCollection <IContentItem>();

            SelectItem    = new Command <IContentItem>((parameter) => SelectedItem = parameter);
            ChannelLogin  = new Command <IContentItem>(async(parameter) => await PerformChannelLogin(parameter));
            ChannelLogout = new Command <IContentItem>(async(parameter) => await PerformChannelLogout(parameter));
            ChannelLoginFromAccountSection = new Command <IContentItem>(async(parameter) => await PerformChannelLogin(parameter));
            ChannelLoginHelp = new Command <IContentItem>((parameter) => MessagingCenterManager.ShowPopup(new ChannelLoginHelp()
            {
                BindingContext = this
            }));
            GoBack = new Command(() => goBack());
            Search = new Command <string>(async(parameter) => await search(parameter));
            ShowChannelLoginControls = new Command(() => MessagingCenterManager.ShowPopup(new ChannelLoginPopup()
            {
                BindingContext = this
            }));
            ShowLoginDropdown    = new Command(() => MessagingCenterManager.ShowPopup(new LoginPopup()));
            ShowChannelLoginInfo = new Command(() => MessagingCenterManager.ShowPopup(new ChannelLoginInfoView()));
            HideLoginInfoBar     = new Command(() =>
            {
                if (selectedChannel is ChannelEx)
                {
                    if ((selectedChannel as ChannelEx).LoginInfo == null)
                    {
                        (selectedChannel as ChannelEx).LoginInfo = new ChannelLoginInfo();
                    }

                    (selectedChannel as ChannelEx).LoginInfo.HideLoginInfoBar = true;
                }
            });

            RefreshSelected = new Command(async() => await RefreshSelectedFolder());
        }