本文整理汇总了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;
}
示例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;
}
示例3: GetMessage
protected string GetMessage(NavigationContext navigationContext)
{
return (string) navigationContext.GetContextVariable(Consts.KEY_MESSAGE, false);
}
示例4: GetCurrentPlaylist
protected PlaylistBase GetCurrentPlaylist(NavigationContext navigationContext)
{
return (PlaylistBase) navigationContext.GetContextVariable(Consts.KEY_PLAYLIST_DATA, false);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例10: GetNavigationItems
protected static ItemsList GetNavigationItems(NavigationContext context)
{
return (ItemsList) context.GetContextVariable(NAVIGATION_ITEMS_KEY, false);
}
示例11: PrepareState
protected bool PrepareState(NavigationContext context)
{
MediaItem item = (MediaItem)context.GetContextVariable(KEY_MEDIA_ITEM, false);
return item != null && FillItemsList(item);
}
示例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;
}
}
示例13: GetMenuItems
protected ItemsList GetMenuItems(NavigationContext context)
{
return (ItemsList) context.GetContextVariable(Consts.KEY_MENU_ITEMS, false);
}
示例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);
}
}
示例15: GetNavigationData
public static NavigationData GetNavigationData(NavigationContext context)
{
return context == null ? null : context.GetContextVariable(NavigationData.NAVIGATION_DATA, false) as NavigationData;
}