Example #1
0
        public static string GetHelpUrl()
        {
            string uri         = Shell.LoadString(StringId.IDS_WWW_ZUNE_NET_SUPPORT_URL);
            string lynxCulture = FeatureEnablement.GetLynxCulture();

            if (!string.IsNullOrEmpty(lynxCulture))
            {
                uri = AppendFwlinkCulture(uri, lynxCulture);
            }
            StringBuilder args   = new StringBuilder(uri);
            string        uiPath = ZuneShell.DefaultInstance.CurrentPage.UIPath;

            if (!string.IsNullOrEmpty(uiPath))
            {
                UrlHelper.AppendParam(false, args, "path", uiPath);
            }
            foreach (UIDevice uiDevice in SingletonModelItem <UIDeviceList> .Instance)
            {
                if (uiDevice.IsConnectedToPC || SignIn.Instance.SignedIn && uiDevice.UserId == SignIn.Instance.LastSignedInUserId)
                {
                    UrlHelper.AppendParam(false, args, "mfr", uiDevice.Manufacturer);
                    UrlHelper.AppendParam(false, args, "mdl", uiDevice.ModelName);
                }
            }
            return(args.ToString());
        }
Example #2
0
 protected override void OnEndActivationRequests(object args)
 {
     if (args == null)
     {
         this.NavigateToErrorHandler();
     }
     else
     {
         this.InitializeSettings();
         AccountUser accountUser = (AccountUser)args;
         this.CommittedSettings = accountUser.AccountSettings;
         if (this.ShowSettings != PrivacyInfoSettings.None)
         {
             return;
         }
         if (accountUser.AccountUserType == AccountUserType.Adult)
         {
             this.ShowSettings = PrivacyInfoSettings.SocialSettings;
         }
         else if (accountUser.AccountUserType == AccountUserType.ChildWithSocial)
         {
             this.ShowSettings = FeatureEnablement.IsFeatureEnabled(Features.eSocial) ? PrivacyInfoSettings.CreateChildAccountWithSocial : PrivacyInfoSettings.CreateChildAccount;
         }
         else
         {
             this.ShowSettings = PrivacyInfoSettings.CreateChildAccount;
         }
     }
 }
Example #3
0
        public static bool ShowYomiSortFields()
        {
            string letterIsoLanguageName = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
            string region = FeatureEnablement.GetRegion();

            return(letterIsoLanguageName.Equals("ja", StringComparison.OrdinalIgnoreCase) || region.Equals("jp", StringComparison.OrdinalIgnoreCase));
        }
Example #4
0
        public static bool IsEnUs()
        {
            bool flag1 = Thread.CurrentThread.CurrentUICulture.Equals(new CultureInfo("en-US"));
            bool flag2 = StringHelper.IsEqualCaseInsensitive(FeatureEnablement.GetRegion(), "US");

            return(flag1 && flag2);
        }
Example #5
0
 internal Right GetOfferRight(
     MediaRightsEnum right,
     VideoDefinitionEnum definition,
     PriceTypeEnum priceType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.IsAssociatedFeatureEnabled(right))
     {
         if (definition == VideoDefinitionEnum.None)
         {
             Right right1 = (this.GetOfferRight(right, VideoDefinitionEnum.HD, priceType) ?? this.GetOfferRight(right, VideoDefinitionEnum.SD, priceType)) ?? this.GetOfferRight(right, VideoDefinitionEnum.XD, priceType);
             if (right1 != null)
             {
                 return(right1);
             }
         }
         if (this.Rights != null)
         {
             foreach (Right right1 in Rights)
             {
                 if (right == right1.RightEnum && priceType == right1.PriceTypeEnum && (definition == right1.VideoDefinitionEnum || definition == VideoDefinitionEnum.None) && (right1.VideoResolutionEnum != VideoResolutionEnum.VR_1080P || right1.RightEnum != MediaRightsEnum.Purchase))
                 {
                     return(right1);
                 }
             }
         }
     }
     return(null);
 }
Example #6
0
        private static string GetViewUri(string id, string type)
        {
            string endPointUri = Microsoft.Zune.Service.Service.GetEndPointUri(Microsoft.Zune.Service.EServiceEndpointId.SEID_Lynx);
            string str         = FeatureEnablement.IsFeatureEnabled(Features.eSocial) ? "View" : "ViewUnsupportedMarket";

            return("Web\\" + UrlHelper.MakeUrlEx(endPointUri + "/redirect", nameof(type), type, nameof(id), id, "target", "web", "action", str));
        }
Example #7
0
        private void UpdateDeviceDependentPivots()
        {
            UIDevice currentDevice = SyncControls.Instance.CurrentDevice;

            if (this.NodesList.Contains(Applications))
            {
                this.NodesList.Remove(Applications);
            }
            if (this.NodesList.Contains(Friends))
            {
                this.NodesList.Remove(Friends);
            }
            if (this.NodesList.Contains(Channels))
            {
                this.NodesList.Remove(Channels);
            }
            if (FeatureEnablement.IsFeatureEnabled(Features.eSocial) && currentDevice.SupportsUserCards)
            {
                this.NodesList.Add(Friends);
            }
            if (FeatureEnablement.IsFeatureEnabled(Features.eChannels) && currentDevice.SupportsChannels)
            {
                this.NodesList.Add(Channels);
            }
            if (!FeatureEnablement.IsFeatureEnabled(Features.eGames) || !currentDevice.SupportsSyncApplications)
            {
                return;
            }
            this.NodesList.Add(Applications);
        }
        internal override string GetResourceUri()
        {
            string property1 = (string)this.Query.GetProperty("Prefix");

            if (!Search.Instance.IsValidKeyword(property1))
            {
                return(null);
            }
            string        endPointUri   = Microsoft.Zune.Service.Service.GetEndPointUri(this._endPoint);
            StringBuilder stringBuilder = new StringBuilder(128);

            stringBuilder.Append(endPointUri);
            stringBuilder.Append("/?prefix=");
            stringBuilder.Append(Uri.EscapeDataString(property1));
            if ((bool)this.Query.GetProperty("OnlyIncludeZuneRadioArtists"))
            {
                if (FeatureEnablement.IsFeatureEnabled(Features.eMusic))
                {
                    stringBuilder.Append("&includeZuneRadioArtists=true");
                }
            }
            else
            {
                if (FeatureEnablement.IsFeatureEnabled(Features.eMusic))
                {
                    stringBuilder.Append("&includeTracks=true");
                    stringBuilder.Append("&includeAlbums=true");
                    stringBuilder.Append("&includeArtists=true");
                }
                if (FeatureEnablement.IsFeatureEnabled(Features.eVideos))
                {
                    stringBuilder.Append("&includeMovies=true");
                    stringBuilder.Append("&includeVideoShorts=true");
                }
                if (FeatureEnablement.IsFeatureEnabled(Features.eTV))
                {
                    stringBuilder.Append("&includeTVSeries=true");
                }
                if (FeatureEnablement.IsFeatureEnabled(Features.eMusicVideos))
                {
                    stringBuilder.Append("&includeMusicVideos=true");
                }
                if (FeatureEnablement.IsFeatureEnabled(Features.ePodcasts))
                {
                    stringBuilder.Append("&includePodcasts=true");
                }
                if (FeatureEnablement.IsFeatureEnabled(Features.eApps))
                {
                    stringBuilder.Append("&includeApplications=true");
                }
            }
            string property2 = (string)this.Query.GetProperty("ClientType");

            if (!string.IsNullOrEmpty(property2))
            {
                stringBuilder.Append("&clientType=");
                stringBuilder.Append(property2);
            }
            return(stringBuilder.ToString());
        }
Example #9
0
 public static void CheckValidRegionAndLanguage()
 {
     if (FeatureEnablement.HasValidRegionAndLanguage())
     {
         return;
     }
     ErrorDialogInfo.Show(HRESULT._ZUNE_E_UNKNOWN_REGION_OR_LANGUAGE.Int, Shell.LoadString(StringId.IDS_UNKNOWN_REGION_OR_LANGUAGE_TITLE));
 }
Example #10
0
 public override void UpdateState()
 {
     base.UpdateState();
     if (this.TrackModel == null || this.CanFindInCollection || this.CanFindInHiddenCollection)
     {
         return;
     }
     if (!this.Downloading)
     {
         if (this.TrackModel.CanPurchaseFree)
         {
             this.Description = Shell.LoadString(StringId.IDS_FREE);
             this.Available   = true;
         }
         else if (this.TrackModel.CanDownload)
         {
             this.Description = Shell.LoadString(StringId.IDS_DOWNLOAD);
             this.Available   = !this.DownloadingHidden;
         }
         else if (this.TrackModel.CanPurchaseSubscriptionFree)
         {
             this.Description = Shell.LoadString(StringId.IDS_PURCHASE_BUTTON);
             this.Available   = true;
         }
         else if (this.TrackModel.CanPurchaseAlbumOnly)
         {
             this.Description = Shell.LoadString(StringId.IDS_ALBUM_ONLY);
             this.Available   = false;
         }
         else if (this.TrackModel.CanPurchase)
         {
             this.Description = string.Format(Shell.LoadString(StringId.IDS_BUY), TrackModel.PointsPrice);
             this.Available   = true;
             this.HasPoints   = this.TrackModel.HasPoints;
         }
         else if (this.TrackModel.CanSubscriptionPlay)
         {
             this.Description = Shell.LoadString(StringId.IDS_PLAY_SONG);
             this.Available   = true;
         }
         else if (this.TrackModel.CanPreview)
         {
             this.Description = Shell.LoadString(StringId.IDS_PREVIEW_SONG);
             this.Available   = true;
         }
         else if (this.CanFindInZuneDotNet && !FeatureEnablement.IsFeatureEnabled(Features.eMusic))
         {
             this.Description = Shell.LoadString(StringId.IDS_MORE_INFO);
             this.Available   = true;
         }
     }
     if (this.TrackModel.CanPurchase || !(Download.Instance.GetErrorCode(this.Id) == HRESULT._NS_E_MEDIA_NOT_PURCHASED))
     {
         return;
     }
     Download.Instance.SetErrorCode(this.Id, HRESULT._S_OK.Int);
 }
Example #11
0
 internal override void Activate()
 {
     if (!this._activated)
     {
         this._activated = true;
         ZuneShell.DefaultInstance.Management.MediaInfoChoice.Value = FeatureEnablement.IsFeatureEnabled(Features.eOptIn);
     }
     base.Activate();
 }
Example #12
0
        public static string AppendLynxCultureQueryString(string uri, bool first)
        {
            string lynxCulture = FeatureEnablement.GetLynxCulture();

            if (string.IsNullOrEmpty(lynxCulture))
            {
                return(uri);
            }
            return(first ? string.Format("{0}?culture={1}", uri, lynxCulture) : string.Format("{0}&culture={1}", uri, lynxCulture));
        }
Example #13
0
        private bool IsAssociatedFeatureEnabled(MediaRightsEnum right)
        {
            bool flag = true;

            if (right == MediaRightsEnum.RentStream && !FeatureEnablement.IsFeatureEnabled(Features.eMBRRental) || right == MediaRightsEnum.PreviewStream && !FeatureEnablement.IsFeatureEnabled(Features.eMBRPreview) || right == MediaRightsEnum.PurchaseStream && !FeatureEnablement.IsFeatureEnabled(Features.eMBRPurchase))
            {
                flag = false;
            }
            return(flag);
        }
Example #14
0
        public static string AppendFwlinkLynxCulture(string uri)
        {
            string lynxCulture = FeatureEnablement.GetLynxCulture();

            if (!string.IsNullOrEmpty(lynxCulture))
            {
                uri = AppendFwlinkCulture(uri, lynxCulture);
            }
            return(uri);
        }
Example #15
0
        public static string GetPrivacyUrl()
        {
            string uri         = Shell.LoadString(StringId.IDS_PRIVACY_STATEMENT_URL);
            string lynxCulture = FeatureEnablement.GetLynxCulture();

            if (!string.IsNullOrEmpty(lynxCulture))
            {
                uri = AppendFwlinkCulture(uri, lynxCulture);
            }
            return(uri);
        }
Example #16
0
        public static string GetCurrentRegionDisplayName()
        {
            string region = FeatureEnablement.GetRegion();

            try
            {
                return(new RegionInfo(FeatureEnablement.GetRegion()).DisplayName);
            }
            catch (ArgumentException ex)
            {
                return(region);
            }
        }
Example #17
0
 internal bool HasAnyRights()
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.Rights != null)
     {
         foreach (Right right in Rights)
         {
             if (this.IsAssociatedFeatureEnabled(right.RightEnum))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Example #18
0
 internal bool HasRights(MediaRightsEnum right, ClientTypeEnum clientType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.Rights != null)
     {
         foreach (Right right1 in Rights)
         {
             if (right == right1.RightEnum && clientType == right1.ClientTypeEnum)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Example #19
0
 internal Right GetOfferRight(ClientTypeEnum clientType, PriceTypeEnum priceType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.Rights != null)
     {
         foreach (Right right in Rights)
         {
             if (clientType == right.ClientTypeEnum && priceType == right.PriceTypeEnum && Guid.Empty != right.OfferId)
             {
                 return(right);
             }
         }
     }
     return(null);
 }
Example #20
0
 internal bool HasRights(MediaRightsEnum right, AudioEncodingEnum encoding)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMusic) && this.Rights != null)
     {
         foreach (Right right1 in Rights)
         {
             if (right == right1.RightEnum && encoding == right1.AudioEncodingEnum)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Example #21
0
 internal bool HasRights(ClientTypeEnum clientType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.Rights != null)
     {
         foreach (Right right in Rights)
         {
             if (clientType == right.ClientTypeEnum)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Example #22
0
 public DownloadsPage(bool collection)
 {
     this.UI = "res://ZuneMarketplaceResources!DownloadsData.uix#MarketplaceDownloads";
     if (collection || !FeatureEnablement.IsFeatureEnabled(Features.eMarketplace))
     {
         this.PivotPreference = Shell.MainFrame.Collection.Downloads;
         this.UIPath          = "Collection\\Downloads";
     }
     else
     {
         this.PivotPreference = Shell.MainFrame.Marketplace.Downloads;
         this.UIPath          = "Marketplace\\Downloads\\Home";
     }
     this.IsRootPage = true;
 }
 public FirstLaunchLandPage()
 {
     this.UI = "res://ZuneShellResources!SetupLand.uix#FirstLaunch";
     if (Fue.Instance.AutoFUE)
     {
         this.BackgroundUI = "res://ZuneShellResources!SetupLand.uix#SetupLandBackground";
     }
     else if (FeatureEnablement.IsFeatureEnabled(Features.eFirstLaunchIntroVideo))
     {
         this.BackgroundUI = "res://ZuneShellResources!SetupLand.uix#FirstLaunchBackground";
     }
     else
     {
         this.BackgroundUI = "res://ZuneShellResources!SetupLand.uix#FirstLaunchNoVideoBackground";
     }
 }
Example #24
0
 internal Right GetOfferRight(
     MediaRightsEnum right,
     AudioEncodingEnum encoding,
     PriceTypeEnum priceType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMusic) && this.Rights != null)
     {
         foreach (Right right1 in Rights)
         {
             if (right == right1.RightEnum && priceType == right1.PriceTypeEnum && (encoding == right1.AudioEncodingEnum && right1.OfferId != Guid.Empty))
             {
                 return(right1);
             }
         }
     }
     return(null);
 }
Example #25
0
 internal Right GetOfferRight(
     MediaRightsEnum right,
     ClientTypeEnum clientType,
     PriceTypeEnum priceType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.Rights != null)
     {
         foreach (Right right1 in Rights)
         {
             if (right == right1.RightEnum && clientType == right1.ClientTypeEnum && (priceType == right1.PriceTypeEnum && Guid.Empty != right1.OfferId))
             {
                 return(right1);
             }
         }
     }
     return(null);
 }
Example #26
0
        public static void CheckMarketplaceCulture()
        {
            if (s_marketplaceCultureChecked)
            {
                return;
            }
            string marketplaceCulture1 = FeatureEnablement.GetMarketplaceCulture();

            if (string.IsNullOrEmpty(marketplaceCulture1))
            {
                return;
            }
            s_marketplaceCultureChecked = true;
            string strB = null;

            if (marketplaceCulture1.Length > 1)
            {
                strB = marketplaceCulture1.Substring(0, 2);
            }
            string strA1 = CultureInfo.CurrentUICulture.ToString();
            string strA2 = null;

            if (strA1.Length > 1)
            {
                strA2 = strA1.Substring(0, 2);
            }
            bool flag1 = 0 == string.Compare(strA2, strB, StringComparison.InvariantCultureIgnoreCase);
            bool flag2 = false;
            bool flag3 = false;

            if (!flag1)
            {
                string marketplaceCulture2 = ClientConfiguration.Shell.LastMarketplaceCulture;
                flag2 = 0 != string.Compare(marketplaceCulture1, marketplaceCulture2, StringComparison.InvariantCultureIgnoreCase);
                string lastClientCulture = ClientConfiguration.Shell.LastClientCulture;
                flag3 = 0 != string.Compare(strA1, lastClientCulture, StringComparison.InvariantCultureIgnoreCase);
            }
            ClientConfiguration.Shell.LastMarketplaceCulture = marketplaceCulture1;
            ClientConfiguration.Shell.LastClientCulture      = strA1;
            if (flag1 || !flag2 && !flag3)
            {
                return;
            }
            MessageBox.Show(Shell.LoadString(StringId.IDS_MARKETPLACE_CULTURE_MISMATCH_TITLE), Shell.LoadString(StringId.IDS_MARKETPLACE_CULTURE_MISMATCH), null);
        }
 public FirstConnectWizard()
 {
     this.AddPage(new FirstConnectDeviceNamePage(this));
     if (FeatureEnablement.IsFeatureEnabled(Features.eSocial) || FeatureEnablement.IsFeatureEnabled(Features.eMarketplace))
     {
         this.AddPage(new FirstConnectDeviceMarketplacePage(this));
     }
     this.AddPage(new FirstConnectDeviceSyncOptionsPage(this));
     if (this.ActiveDevice.SupportsUsageData)
     {
         this.AddPage(new FirstConnectDeviceCustomPrivacyPage(this));
     }
     else
     {
         ZuneShell.DefaultInstance.Management.DeviceManagement.PrivacyChoice.Value = false;
     }
     ZuneShell.DefaultInstance.Management.DeviceManagement.DevicePartnership = DeviceRelationship.Permanent;
 }
Example #28
0
 internal Right GetOfferRight(
     MediaRightsEnum right,
     VideoDefinitionEnum definition1,
     VideoDefinitionEnum definition2,
     PriceTypeEnum priceType)
 {
     if (FeatureEnablement.IsFeatureEnabled(Features.eMarketplace) && this.IsAssociatedFeatureEnabled(right) && this.Rights != null)
     {
         foreach (Right right1 in Rights)
         {
             if (right == right1.RightEnum && definition1 == right1.VideoDefinitionEnum && priceType == right1.PriceTypeEnum)
             {
                 foreach (Right right2 in Rights)
                 {
                     if (right1 != right2 && right == right2.RightEnum && (definition2 == right2.VideoDefinitionEnum && priceType == right2.PriceTypeEnum) && right1.OfferId == right2.OfferId)
                     {
                         return(right2);
                     }
                 }
             }
         }
     }
     return(null);
 }
Example #29
0
 public static bool IsValidGeoId(uint geoId) => (int)FeatureEnablement.GetInvalidGeoId() != (int)geoId;
Example #30
0
 internal static string GetDefaultCountry() => FeatureEnablement.GetRegion();