Exemple #1
0
        public static string GetTitle(this IApplicationResources resources, PlaylistType playlistType)
        {
            switch (playlistType)
            {
            case PlaylistType.Album:
                return(resources.GetString("Model_Album_Title"));

            case PlaylistType.Artist:
                return(resources.GetString("Model_Artist_Title"));

            case PlaylistType.Genre:
                return(resources.GetString("Model_Genre_Title"));

            case PlaylistType.UserPlaylist:
                return(resources.GetString("Model_UserPlaylist_Title"));

            case PlaylistType.Radio:
                return(resources.GetString("MainMenu_Radio"));

            default:
                return(null);
            }
        }
Exemple #2
0
        public static string GetPluralTitle(this IApplicationResources resources, PlaylistType playlistType)
        {
            switch (playlistType)
            {
            case PlaylistType.Album:
                return(resources.GetString("Model_Album_Plural_Title"));

            case PlaylistType.Artist:
                return(resources.GetString("Model_Artist_Plural_Title"));

            case PlaylistType.Genre:
                return(resources.GetString("Model_Genre_Plural_Title"));

            case PlaylistType.UserPlaylist:
                return(resources.GetString("Model_UserPlaylist_Plural_Title"));

            case PlaylistType.Radio:
                return(SettingsService.Value.GetIsAllAccessAvailable() ? resources.GetString("Model_Radio_Plural_Title") : resources.GetString("Model_InstantMixes_Plural_Title"));

            default:
                return(null);
            }
        }
        public static void Initialize(IApplicationSettingViewsService service, IApplicationResources resources)
        {
            service.RegisterSettings <AccountsView>("accounts", resources.GetString("SettingsAccountTitle"));
            service.RegisterSettings <AppSettingsView>("appsettings", resources.GetString("SettingsAppSettingsTitle"));
            service.RegisterSettings <OfflineCacheView>("offlinecache", resources.GetString("OfflineCacheAppSettingsTitle"), ApplicationSettingLayoutType.Large);

            bool upgradeViewRegistered = false;

            if (!InAppPurchases.HasFeature(GoogleMusicFeatures.All))
            {
                service.RegisterSettings <UpgradeView>("upgrade", resources.GetString("SettingsUpgradeTitle"));
                upgradeViewRegistered = true;
            }

            service.RegisterSettings <SupportView>("support", resources.GetString("SettingsSupportTitle"));
            service.RegisterSettings <PrivacyView>("privacy", resources.GetString("SettingsPrivacyPolicyTitle"));
            service.RegisterSettings <LegalView>("legal", resources.GetString("SettingsLegalTitle"));

            InAppPurchases.LicenseChanged += () =>
            {
                if (!InAppPurchases.HasFeature(GoogleMusicFeatures.All))
                {
                    if (!upgradeViewRegistered)
                    {
                        service.RegisterSettings <UpgradeView>("upgrade", "SettingsUpgradeTitle", ApplicationSettingLayoutType.Standard, "accounts");
                        upgradeViewRegistered = true;
                    }
                }
                else
                {
                    if (upgradeViewRegistered)
                    {
                        service.UnregisterSettings("upgrade");
                        upgradeViewRegistered = false;
                    }
                }
            };

#if DEBUG
            InAppPurchases.SimulatorInAppPurchasesInitialization();
#endif
        }
Exemple #4
0
        public static IEnumerable <MenuItemMetadata> GetItems(IApplicationResources resources, IApplicationStateService stateService, ISettingsService settingsService)
        {
            yield return(MenuItemMetadata.FromViewType <IStartPageView>(new { Title = resources.GetString("MainMenu_Home"), Icon = "ms-appx:///Resources/home.png" }));

            yield return(MenuItemMetadata.FromViewType <ICurrentPlaylistPageView>(new { Title = resources.GetString("MainMenu_Queue"), Icon = "ms-appx:///Resources/queue.png" }));

            yield return(MenuItemMetadata.FromViewType <IUserPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Playlists"), Icon = "ms-appx:///Resources/playlists.png" }, PlaylistType.UserPlaylist));

            yield return(MenuItemMetadata.FromViewType <IPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Artists"), Icon = "ms-appx:///Resources/artists.png" }, PlaylistType.Artist));

            yield return(MenuItemMetadata.FromViewType <IPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Albums"), Icon = "ms-appx:///Resources/albums.png" }, PlaylistType.Album));

            yield return(MenuItemMetadata.FromViewType <IPlaylistsPageView>(new { Title = resources.GetString("MainMenu_Genres"), Icon = "ms-appx:///Resources/genres.png" }, PlaylistType.Genre));

            if (stateService.CurrentState == ApplicationState.Online)
            {
                yield return(MenuItemMetadata.FromViewType <IRadioPageView>(new { Title = settingsService.GetIsAllAccessAvailable() ? resources.GetString("MainMenu_Radio") : resources.GetString("MainMenu_InstantMixes"), Icon = "ms-appx:///Resources/Radio.png" }, PlaylistType.Radio));
            }
        }