当前位置: 首页>>代码示例>>C#>>正文


C# NavigationContext.GetContextVariable方法代码示例

本文整理汇总了C#中MediaPortal.UI.Presentation.Workflow.NavigationContext.GetContextVariable方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationContext.GetContextVariable方法的具体用法?C# NavigationContext.GetContextVariable怎么用?C# NavigationContext.GetContextVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaPortal.UI.Presentation.Workflow.NavigationContext的用法示例。


在下文中一共展示了NavigationContext.GetContextVariable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetNavigationData

 public static NavigationData GetNavigationData(NavigationContext navigationContext, bool inheritFromPredecessor)
 {
   return navigationContext == null ? null :
     navigationContext.GetContextVariable(Consts.KEY_NAVIGATION_DATA, inheritFromPredecessor) as NavigationData;
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:5,代码来源:MediaNavigationModel.cs

示例2: GetMode

 protected internal static string GetMode(NavigationContext context)
 {
   if (context == null)
     return MediaNavigationMode.BrowseLocalMedia;
   return (context.GetContextVariable(Consts.KEY_NAVIGATION_MODE, true) as string) ?? MediaNavigationMode.BrowseLocalMedia;
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:6,代码来源:MediaNavigationModel.cs

示例3: GetMessage

 protected string GetMessage(NavigationContext navigationContext)
 {
   return (string) navigationContext.GetContextVariable(Consts.KEY_MESSAGE, false);
 }
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:4,代码来源:ManagePlaylistsModel.cs

示例4: GetCurrentPlaylist

 protected PlaylistBase GetCurrentPlaylist(NavigationContext navigationContext)
 {
   return (PlaylistBase) navigationContext.GetContextVariable(Consts.KEY_PLAYLIST_DATA, false);
 }
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:4,代码来源:ManagePlaylistsModel.cs

示例5: CanEnterState

 public bool CanEnterState(NavigationContext oldContext, NavigationContext newContext)
 {
   if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CONFIGURATION_DIALOG)
   {
     UpdatePlayerConfigurationMenu();
     return _playerConfigurationMenu.Count > 0;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_CHOOSE_AUDIO_STREAM_DIALOG)
   {
     UpdateAudioStreamsMenu();
     return _audioStreamsMenu.Count > 0;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_AUDIO_MENU_DIALOG)
   {
     // Check if we got our necessary player slot parameter
     if (newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) != null)
       return true;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_GEOMETRY_MENU_DIALOG)
   {
     // Check if we got our necessary player context parameter
     if (newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) != null)
       return true;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_EFFECT_MENU_DIALOG)
   {
     // Check if we got our necessary player context parameter
     if (newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) != null)
       return true;
   }
   return false;
 }
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:32,代码来源:PlayerConfigurationDialogModel.cs

示例6: EnterModelContext

 public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
 {
   _playlist = null;
   _messageQueue.Start();
   bool? disableEditMode = (bool?) newContext.GetContextVariable(Consts.KEY_DISABLE_EDIT_MODE, false);
   _disableEditMode = disableEditMode.HasValue && disableEditMode.Value;
   UpdatePlaylist();
   UpdateProperties();
   UpdateSubMenuLists();
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:10,代码来源:ShowPlaylistModel.cs

示例7: GetConfigLocation

 /// <summary>
 /// Returns the config location corresponding to the workflow state given by the specified
 /// workflow navigation <paramref name="context"/>.
 /// </summary>
 /// <param name="context">The workflow navigation context to lookup the context state.</param>
 /// <returns>Previously initialized config location of the given navigation <paramref name="context"/> or <c>"/"</c>,
 /// if the context wasn't initialized before.</returns>
 protected static string GetConfigLocation(NavigationContext context)
 {
   string result = context.GetContextVariable(CONFIG_LOCATION_KEY, false) as string;
   if (result == null)
     context.SetContextVariable(CONFIG_LOCATION_KEY, result = "/");
   return result;
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:14,代码来源:ConfigurationModel.cs

示例8: EnterContext

 protected void EnterContext(NavigationContext newContext)
 {
   _messageQueue.Start();
   if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CONFIGURATION_DIALOG)
   {
     UpdatePlayerConfigurationMenu();
     _inPlayerConfigurationDialog = true;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_CHOOSE_AUDIO_STREAM_DIALOG)
   {
     UpdateAudioStreamsMenu();
     _inChooseAudioStreamDialog = true;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_AUDIO_MENU_DIALOG)
   {
     _playerAudioMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
     bool? showToggleMute = newContext.GetContextVariable(Consts.KEY_SHOW_MUTE, false) as bool?;
     _showToggleMute = showToggleMute ?? true;
     UpdatePlayerSlotAudioMenu();
     _inPlayerSlotAudioMenuDialog = true;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_GEOMETRY_MENU_DIALOG)
   {
     _playerGeometryMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
     UpdatePlayerChooseGeometryMenu();
     _inPlayerChooseGeometryMenuDialog = true;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_PLAYER_CHOOSE_EFFECT_MENU_DIALOG)
   {
     _playerEffectMenuPlayerContext = newContext.GetContextVariable(Consts.KEY_PLAYER_CONTEXT, false) as IPlayerContext;
     UpdatePlayerChooseEffectMenu();
     _inPlayerChooseEffectMenuDialog = true;
   }
 }
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:34,代码来源:PlayerConfigurationDialogModel.cs

示例9: PrepareState

 protected void PrepareState(NavigationContext context)
 {
   Guid workflowStateId = context.WorkflowState.StateId;
   if (workflowStateId == Consts.WF_STATE_ID_PLAY_OR_ENQUEUE_ITEMS)
   {
     AVType avType = (AVType) context.GetContextVariable(KEY_AV_TYPE, false);
     GetMediaItemsDlgt getMediaItemsFunction = (GetMediaItemsDlgt) context.GetContextVariable(KEY_GET_MEDIA_ITEMS_FUNCTION, false);
     bool doPlay = (bool) context.GetContextVariable(KEY_DO_PLAY, false);
     PlayerContextConcurrencyMode concurrencyMode = (PlayerContextConcurrencyMode) context.GetContextVariable(KEY_CONCURRENCY_MODE, false);
     PlayOrEnqueueItemsInternal(getMediaItemsFunction, avType, doPlay, concurrencyMode);
   }
   else if (workflowStateId == Consts.WF_STATE_ID_CHECK_RESUME_SINGLE_ITEM)
   {
     MediaItem item = (MediaItem) context.GetContextVariable(KEY_MEDIA_ITEM, false);
     CheckResumeMenuInternal(item);
   }
   else if (workflowStateId == Consts.WF_STATE_ID_CHECK_QUERY_PLAYACTION_SINGLE_ITEM)
   {
     MediaItem item = (MediaItem) context.GetContextVariable(KEY_MEDIA_ITEM, false);
     CheckPlayMenuInternal(item);
   }
   else if (workflowStateId == Consts.WF_STATE_ID_CHECK_QUERY_PLAYACTION_MULTIPLE_ITEMS)
   {
     GetMediaItemsDlgt getMediaItemsFunction = (GetMediaItemsDlgt) context.GetContextVariable(KEY_GET_MEDIA_ITEMS_FUNCTION, false);
     AVType avType = (AVType) context.GetContextVariable(KEY_AV_TYPE, false);
     CheckPlayMenuInternal(getMediaItemsFunction, avType);
   }
   else if (workflowStateId == Consts.WF_STATE_ID_QUERY_AV_TYPE_CHECK_QUERY_PLAYACTION_MULTIPLE_ITEMS)
   {
     GetMediaItemsDlgt getMediaItemsFunction = (GetMediaItemsDlgt) context.GetContextVariable(KEY_GET_MEDIA_ITEMS_FUNCTION, false);
     CheckQueryPlayAction_ShowMediaTypeChoice(getMediaItemsFunction);
   }
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:33,代码来源:PlayItemsModel.cs

示例10: GetNavigationItems

 protected static ItemsList GetNavigationItems(NavigationContext context)
 {
   return (ItemsList) context.GetContextVariable(NAVIGATION_ITEMS_KEY, false);
 }
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:4,代码来源:WorkflowNavigationBar.cs

示例11: PrepareState

 protected bool PrepareState(NavigationContext context)
 {
   MediaItem item = (MediaItem)context.GetContextVariable(KEY_MEDIA_ITEM, false);
   return item != null && FillItemsList(item);
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:5,代码来源:MediaItemsActionModel.cs

示例12: EnterModelContext

 public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
 {
   _messageQueue.Start();
   if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_ATTACH_TO_SERVER)
   {
     lock (_syncObj)
       _mode = Mode.AttachToServer;
     object o = newContext.GetContextVariable(Consts.KEY_AUTO_CLOSE_ON_NO_SERVER, false);
     if (o != null)
       _autoCloseOnNoServer = (bool) o;
   }
   else if (newContext.WorkflowState.StateId == Consts.WF_STATE_ID_DETACH_FROM_SERVER)
   {
     lock (_syncObj)
       _mode = Mode.DetachFromServer;
   }
 }
开发者ID:HeinA,项目名称:MediaPortal-2,代码行数:17,代码来源:ServerAttachmentModel.cs

示例13: GetMenuItems

 protected ItemsList GetMenuItems(NavigationContext context)
 {
   return (ItemsList) context.GetContextVariable(Consts.KEY_MENU_ITEMS, false);
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:4,代码来源:MenuModel.cs

示例14: UnregisterActionChangeHandlers

 protected void UnregisterActionChangeHandlers(NavigationContext context)
 {
   lock (context.SyncRoot)
   {
     ICollection<WorkflowAction> registeredActions =
         (ICollection<WorkflowAction>) context.GetContextVariable(Consts.KEY_REGISTERED_ACTIONS, false);
     if (registeredActions == null)
       return;
     foreach (WorkflowAction action in registeredActions)
       action.StateChanged -= OnMenuActionStateChanged;
     context.ContextVariables.Remove(Consts.KEY_REGISTERED_ACTIONS);
   }
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:13,代码来源:MenuModel.cs

示例15: GetNavigationData

 public static NavigationData GetNavigationData(NavigationContext context)
 {
     return context == null ? null : context.GetContextVariable(NavigationData.NAVIGATION_DATA, false) as NavigationData;
 }
开发者ID:ministerkrister,项目名称:Emulators,代码行数:4,代码来源:EmulatorsMainModel.cs


注:本文中的MediaPortal.UI.Presentation.Workflow.NavigationContext.GetContextVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。