Пример #1
0
        public static string PCExpirationToString(
            int drmState,
            string fileName,
            int fileType,
            Guid zuneMediaId)
        {
            string str = "";

            switch (drmState)
            {
            case 20:
                str = Shell.LoadString(StringId.IDS_VIDEO_EXPIRED);
                break;

            case 26:
                if (!string.IsNullOrEmpty(fileName))
                {
                    DRMInfo drmInfo = fileType != 43 ? ZuneApplication.Service.GetFileDRMInfo(fileName) : ZuneApplication.Service.GetMediaDRMInfo(zuneMediaId, EContentType.Video);
                    if (drmInfo != null)
                    {
                        if (drmInfo.ValidLicense && drmInfo.HasExpiryDate)
                        {
                            DateTime localTime = DateTime.UtcNow.ToLocalTime();
                            if (drmInfo.ExpiryDate.CompareTo(localTime) > 0)
                            {
                                TimeSpan timeSpan = drmInfo.ExpiryDate.Subtract(localTime);
                                str = timeSpan.TotalHours < 49.0 ? (timeSpan.TotalHours < 2.0 ? (timeSpan.TotalHours < 1.0 ? Shell.LoadString(StringId.IDS_VIDEO_EXPIRATION_MINUTES) : Shell.LoadString(StringId.IDS_VIDEO_EXPIRATION_ONEHOUR)) : string.Format(_hoursExpirationFormat, (int)timeSpan.TotalHours)) : string.Format(_daysExpirationFormat, timeSpan.Days);
                                break;
                            }
                            str = Shell.LoadString(StringId.IDS_VIDEO_EXPIRED);
                            break;
                        }
                        if (drmInfo.LicenseExpired)
                        {
                            str = Shell.LoadString(StringId.IDS_VIDEO_EXPIRED);
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;
            }
            return(str);
        }
Пример #2
0
 public TermsOfServiceWizard()
 {
     this.RequiresSignIn = false;
     this.State.PassportPasswordParentStep.DetailDescription = Shell.LoadString(StringId.IDS_ACCOUNT_TOS_STEP_PARENT_NEEDED);
     this._finishStep = new TermsOfServiceFinishStep(this, this.State);
     this._errorStep  = new AccountManagementErrorPage(this, Shell.LoadString(StringId.IDS_ACCOUNT_TOS_ERROR_TITLE), Shell.LoadString(StringId.IDS_ACCOUNT_TOS_ERROR_DESC));
     SignIn.Instance.SignInStatusUpdatedEvent += new EventHandler(this.OnSignInStatusUpdatedEvent);
 }
Пример #3
0
 public ZuneTagStep(Wizard owner, AccountManagementWizardState state, bool parentAccount)
     : base(owner, state, parentAccount)
 {
     this.Description = Shell.LoadString(StringId.IDS_ACCOUNT_CREATION_ZUNE_TAG_HEADER);
     this.Initialize(new ZuneTagPropertyEditor());
 }
Пример #4
0
 public static void ErrorMessageTooManyNewItems() => ErrorDialogInfo.Show(HRESULT._NS_E_CART_TOO_MANY_NEW_ITEMS.Int, Shell.LoadString(StringId.IDS_CART_FULL));
Пример #5
0
        public static void ErrorMessageMoreCartItemsAvailable(int extraCartItems)
        {
            StringId stringId = extraCartItems == 1 ? StringId.IDS_CART_FULL_MORE_DEVICE_ITEMS_SINGULAR : StringId.IDS_CART_FULL_MORE_DEVICE_ITEMS_PLURAL;

            ErrorDialogInfo.Show(HRESULT._NS_E_CART_MORE_ITEMS_AVAILABLE.Int, Shell.LoadString(StringId.IDS_CART_FULL), string.Format(Shell.LoadString(stringId), extraCartItems));
        }
Пример #6
0
 public EpisodeAttachment(Guid id, string title, string subtitle, string imageUri)
     : base(id, title, subtitle, imageUri)
 {
     this.AttachmentUI = "res://ZuneShellResources!SocialComposer.uix#EpisodeAttachmentUI";
     this.Description  = Shell.LoadString(StringId.IDS_COMPOSE_MESSAGE_VIDEO_ATTACHMENT);
 }
Пример #7
0
 public static void ErrorMessageCartAlreadyFull() => ErrorDialogInfo.Show(HRESULT._NS_E_CART_FULL.Int, Shell.LoadString(StringId.IDS_CART_FULL));
Пример #8
0
 public PlaylistAttachment(Guid id, string title, string imageUri)
     : base(id, title, null, imageUri)
 {
     this.AttachmentUI = "res://ZuneShellResources!SocialComposer.uix#PlaylistAttachmentUI";
     this.Description  = Shell.LoadString(StringId.IDS_COMPOSE_MESSAGE_PLAYLIST_ATTACHMENT);
 }
 public FriendRequestAttachment()
     : base(Guid.Empty, null, null, null)
 {
     this.AttachmentUI = null;
     this.Description  = Shell.LoadString(StringId.IDS_COMPOSE_MESSAGE_FRIENDREQUEST_ATTACHMENT);
 }
 public PurchaseBillingOfferFinishStep(Wizard owner, AccountManagementWizardState state)
     : base(owner, state, Shell.LoadString(StringId.IDS_ACCOUNT_FINISHED_DESCRIPTION))
     => this.RequireSignIn = true;
Пример #11
0
 public MovieAttachment(Guid id, string title, string imageUri)
     : base(id, title, string.Empty, imageUri)
 {
     this.AttachmentUI = "res://ZuneShellResources!SocialComposer.uix#MovieAttachmentUI";
     this.Description  = Shell.LoadString(StringId.IDS_COMPOSE_MESSAGE_MOVIE_ATTACHMENT);
 }
Пример #12
0
        internal static void Show(bool updateFound, bool fIsCritical, bool isUserInitiated)
        {
            if (updateFound)
            {
                EventHandler cancelCommand = null;
                string       message       = !fIsCritical?Shell.LoadString(StringId.IDS_UPDATE_AVAILABLE) : Shell.LoadString(StringId.IDS_CRITICAL_UPDATE_AVAILABLE);

                string  cancelText = Shell.LoadString(StringId.IDS_UPDATE_INSTALL_LATER);
                Command okCommand  = new Command(null, Shell.LoadString(StringId.IDS_UPDATE_INSTALL_NOW), null);
                okCommand.Invoked += delegate
                {
                    SoftwareUpdates.Instance.InstallUpdates();
                };
                if (!isUserInitiated)
                {
                    cancelCommand = (sender, e) => SQMLog.Log(SQMDataId.UserDeferredAutomaticUpdate, 1);
                }
                MessageBox.Show(null, message, okCommand, cancelText, cancelCommand, true);
            }
            else
            {
                MessageBox.Show(null, Shell.LoadString(StringId.IDS_UPDATE_NOT_REQUIRED), null);
            }
        }
Пример #13
0
 public Node(Experience owner, StringId id, string command, SQMDataId sqmCountID)
     : base(owner, Shell.LoadString(id), null)
 {
     this._command    = command;
     this._sqmCountID = sqmCountID;
 }
Пример #14
0
 public MessageTypeInfo(StringId uiText, string detailsTemplate)
 {
     this._UIText          = Shell.LoadString(uiText);
     this._detailsTemplate = detailsTemplate;
 }
Пример #15
0
 private void BatchEndHandler(HRESULT hrAsync) => Application.DeferredInvoke(delegate
 {
     NotificationArea.Instance.Remove(_quickMixCreatingNotification);
     this._quickMixCreatingNotification = null;
     if (this._quickMixSession == null || !hrAsync.IsError)
     {
         return;
     }
     if (hrAsync.Int == HRESULT._ZUNE_E_QUICKMIX_MEDIA_NOT_FOUND)
     {
         MessageBox.Show(Shell.LoadString(StringId.IDS_QUICKMIX_CREATION_UNAVAILABLE_NO_RESULTS_TITLE), Shell.LoadString(this._quickMixNoResultsStringId), null);
     }
     else
     {
         ErrorDialogInfo.Show(hrAsync.Int, Shell.LoadString(StringId.IDS_QUICKMIX_CREATION_UNAVAILABLE_NO_RESULTS_TITLE));
     }
 }, null);
Пример #16
0
        private void AddQuickMixItemsWorker(IList items)
        {
            QuickMix    instance   = QuickMix.Instance;
            HRESULT     hresult    = HRESULT._S_OK;
            EMediaTypes eMediaType = EMediaTypes.eMediaTypeInvalid;

            this._quickMixNoResultsStringId = StringId.IDS_QUICKMIX_ITEM_CREATION_UNAVAILABLE_TEXT;
            if (this._quickMixSession != null)
            {
                this._quickMixSession.Dispose();
                this._quickMixSession = null;
            }
            NotificationArea.Instance.RemoveAll(NotificationTask.QuickMix, NotificationState.OneShot);
            if (items[0] is Artist artist)
            {
                this._quickMixNoResultsStringId = StringId.IDS_QUICKMIX_ARTIST_CREATION_UNAVAILABLE_TEXT;
                hresult = instance.CreateSession(EQuickMixMode.eQuickMixModeNowPlaying, artist.Id, EMediaTypes.eMediaTypePersonArtist, artist.Title, out this._quickMixSession);
                if (hresult.IsSuccess)
                {
                    string text = string.Format(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_ONE_PARAM_TEXT), artist.Title);
                    this._quickMixCreatingNotification = new QuickMixNotification(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_TITLE), text, NotificationState.OneShot, false, 15000);
                    SQMLog.Log(SQMDataId.QuickMixRadioPlays, 1);
                }
            }
            if (hresult.IsSuccess && items[0] is LibraryDataProviderItemBase providerItemBase)
            {
                if (providerItemBase.TypeName == "Artist")
                {
                    eMediaType = EMediaTypes.eMediaTypePersonArtist;
                    this._quickMixNoResultsStringId = StringId.IDS_QUICKMIX_ARTIST_CREATION_UNAVAILABLE_TEXT;
                    string property = (string)providerItemBase.GetProperty("Title");
                    string text     = string.Format(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_ONE_PARAM_TEXT), property);
                    this._quickMixCreatingNotification = new QuickMixNotification(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_TITLE), text, NotificationState.OneShot, false, 15000);
                }
                else if (providerItemBase.TypeName == "Album")
                {
                    eMediaType = EMediaTypes.eMediaTypeAudioAlbum;
                    this._quickMixNoResultsStringId = StringId.IDS_QUICKMIX_ALBUM_CREATION_UNAVAILABLE_TEXT;
                    string property1 = (string)providerItemBase.GetProperty("ArtistName");
                    string property2 = (string)providerItemBase.GetProperty("Title");
                    string text      = string.Format(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_TWO_PARAM_TEXT), property1, property2);
                    this._quickMixCreatingNotification = new QuickMixNotification(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_TITLE), text, NotificationState.OneShot, false, 15000);
                }
                else if (providerItemBase.TypeName == "Track")
                {
                    eMediaType = EMediaTypes.eMediaTypeAudio;
                    this._quickMixNoResultsStringId = StringId.IDS_QUICKMIX_SONG_CREATION_UNAVAILABLE_TEXT;
                    string property1 = (string)providerItemBase.GetProperty("ArtistName");
                    string property2 = (string)providerItemBase.GetProperty("Title");
                    string text      = string.Format(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_TWO_PARAM_TEXT), property1, property2);
                    this._quickMixCreatingNotification = new QuickMixNotification(Shell.LoadString(StringId.IDS_QUICKMIX_NOTIFICATION_CREATION_BUSY_TITLE), text, NotificationState.OneShot, false, 15000);
                }
                int[] seedMediaIds = new int[1]
                {
                    (int)providerItemBase.GetProperty("LibraryId")
                };
                hresult = instance.CreateSession(EQuickMixMode.eQuickMixModeNowPlaying, seedMediaIds, eMediaType, out this._quickMixSession);
                SQMLog.Log(SQMDataId.QuickMixLocalPlays, 1);
            }
            if (hresult.IsSuccess)
            {
                if (this._quickMixSession != null)
                {
                    hresult            = this._quickMixSession.GetSimilarMedia((uint)ClientConfiguration.QuickMix.DefaultPlaylistLength, TimeSpan.FromMilliseconds(15000.0), new SimilarMediaBatchHandler(this.SimilarBatchHandler), new BatchEndHandler(this.BatchEndHandler));
                    this._quickMixType = this._quickMixSession.GetQuickMixType();
                    this._quickMixSession.GetPlaylistTitle(out this._quickMixTitle);
                }
                else
                {
                    hresult = HRESULT._E_UNEXPECTED;
                }
            }
            if (hresult.IsSuccess)
            {
                NotificationArea.Instance.Add(_quickMixCreatingNotification);
            }
            else
            {
                if (this._quickMixSession != null)
                {
                    this._quickMixSession.Dispose();
                    this._quickMixSession = null;
                }
                if (hresult.Int == HRESULT._ZUNE_E_QUICKMIX_MEDIA_NOT_FOUND)
                {
                    MessageBox.Show(Shell.LoadString(StringId.IDS_QUICKMIX_CREATION_UNAVAILABLE_NO_RESULTS_TITLE), Shell.LoadString(this._quickMixNoResultsStringId), null);
                }
                else
                {
                    ErrorDialogInfo.Show(hresult.Int, Shell.LoadString(StringId.IDS_QUICKMIX_CREATION_UNAVAILABLE_NO_RESULTS_TITLE));
                }
            }
        }