protected void AddCurrentViewToPlaylistInternal()
        {
            NavigationData navigationData = NavigationData;

            if (navigationData == null || !navigationData.IsEnabled)
            {
                ServiceRegistration.Get <ILogger>().Error("MediaNavigationModel: Cannot add current view to playlist - There is no enabled navigation data available");
            }
            MediaNavigationMode mode = Mode;

            switch (mode)
            {
            case MediaNavigationMode.Audio:
                PlayItemsModel.CheckQueryPlayAction(GetMediaItemsFromCurrentView, AVType.Audio);
                break;

            case MediaNavigationMode.Movies:
            case MediaNavigationMode.Series:
            case MediaNavigationMode.Videos:
            case MediaNavigationMode.Images:
                PlayItemsModel.CheckQueryPlayAction(GetMediaItemsFromCurrentView, AVType.Video);
                break;

            case MediaNavigationMode.BrowseLocalMedia:
            case MediaNavigationMode.BrowseMediaLibrary:
                PlayItemsModel.CheckQueryPlayAction(GetMediaItemsFromCurrentView);
                break;
            }
        }
 protected internal static void SetMode(MediaNavigationMode mode, NavigationContext context)
 {
     if (context == null)
     {
         return;
     }
     context.SetContextVariable(Consts.KEY_NAVIGATION_MODE, mode);
 }
        protected static IEnumerable <Guid> GetMediaSkinOptionalMIATypes(MediaNavigationMode navigationMode, ISkinResourceBundle bundle)
        {
            if (bundle == null)
            {
                return(EMPTY_GUID_LIST);
            }
            string skinName;
            string themeName;

            GetSkinAndThemeName(bundle, out skinName, out themeName);
            IPluginManager pluginManager        = ServiceRegistration.Get <IPluginManager>();
            string         registrationLocation = Consts.MEDIA_SKIN_SETTINGS_REGISTRATION_PATH + "/" + skinName + "/";

            if (!string.IsNullOrEmpty(themeName))
            {
                registrationLocation += themeName + "/";
            }
            registrationLocation += navigationMode + "/" + Consts.MEDIA_SKIN_SETTINGS_REGISTRATION_OPTIONAL_TYPES_PATH;
            IEnumerable <Guid> result = pluginManager.RequestAllPluginItems <MIATypeRegistration>(
                registrationLocation, _mediaSkinMIATypeRegistrationStateTracker).Select(registration => registration.MediaItemAspectTypeId);

            pluginManager.RevokeAllPluginItems(registrationLocation, _mediaSkinMIATypeRegistrationStateTracker);
            return(result.Union(GetMediaSkinOptionalMIATypes(navigationMode, bundle.InheritedSkinResources)));
        }
 protected static IEnumerable<Guid> GetMediaSkinOptionalMIATypes(MediaNavigationMode navigationMode, ISkinResourceBundle bundle)
 {
   if (bundle == null)
     return EMPTY_GUID_LIST;
   string skinName;
   string themeName;
   GetSkinAndThemeName(bundle, out skinName, out themeName);
   IPluginManager pluginManager = ServiceRegistration.Get<IPluginManager>();
   string registrationLocation = Consts.MEDIA_SKIN_SETTINGS_REGISTRATION_PATH + "/" + skinName + "/";
   if (!string.IsNullOrEmpty(themeName))
     registrationLocation += themeName + "/";
   registrationLocation += navigationMode + "/" + Consts.MEDIA_SKIN_SETTINGS_REGISTRATION_OPTIONAL_TYPES_PATH;
   IEnumerable<Guid> result = pluginManager.RequestAllPluginItems<MIATypeRegistration>(
       registrationLocation, _mediaSkinMIATypeRegistrationStateTracker).Select(registration => registration.MediaItemAspectTypeId);
   pluginManager.RevokeAllPluginItems(registrationLocation, _mediaSkinMIATypeRegistrationStateTracker);
   return result.Union(GetMediaSkinOptionalMIATypes(navigationMode, bundle.InheritedSkinResources));
 }
 // Currently, we don't track skin changes while we're in the media navigation. Normally, that should not be necessary because to switch the skin,
 // the user has to navigate out of media navigation. If we wanted to track skin changes and then update all our navigation data,
 // we would need to register a plugin item registration change listener, which would need to trigger an update of all active media state data.
 protected static IEnumerable<Guid> GetMediaSkinOptionalMIATypes(MediaNavigationMode navigationMode)
 {
   IScreenManager screenManager = ServiceRegistration.Get<IScreenManager>();
   return GetMediaSkinOptionalMIATypes(navigationMode, screenManager.CurrentSkinResourceBundle);
 }
 protected internal static void SetMode(MediaNavigationMode mode, NavigationContext context)
 {
   if (context == null)
     return;
   context.SetContextVariable(Consts.KEY_NAVIGATION_MODE, mode);
 }
        // Currently, we don't track skin changes while we're in the media navigation. Normally, that should not be necessary because to switch the skin,
        // the user has to navigate out of media navigation. If we wanted to track skin changes and then update all our navigation data,
        // we would need to register a plugin item registration change listener, which would need to trigger an update of all active media state data.
        protected static IEnumerable <Guid> GetMediaSkinOptionalMIATypes(MediaNavigationMode navigationMode)
        {
            IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();

            return(GetMediaSkinOptionalMIATypes(navigationMode, screenManager.CurrentSkinResourceBundle));
        }