本文整理汇总了C#中MediaPortal.UI.Presentation.Workflow.NavigationContext.SetContextVariable方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationContext.SetContextVariable方法的具体用法?C# NavigationContext.SetContextVariable怎么用?C# NavigationContext.SetContextVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPortal.UI.Presentation.Workflow.NavigationContext
的用法示例。
在下文中一共展示了NavigationContext.SetContextVariable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareState
/// <summary>
/// Prepares the given workflow navigation <paramref name="context"/>, i.e. prepares the view data and the
/// available filter criteria to be used in the menu.
/// </summary>
protected void PrepareState(NavigationContext context)
{
_currentNavigationContext = context;
NavigationData navigationData = GetNavigationData(context, false);
if (navigationData != null)
return;
// Initialize root media navigation state. We will set up all sub processes for each media model "part", i.e.
// audio, videos, images, browse local media and browse media library.
IDictionary<string, object> contextVariables = PrepareRootState(context.WorkflowState.StateId);
foreach (KeyValuePair<string, object> variable in contextVariables)
context.SetContextVariable(variable.Key, variable.Value);
}
示例2: SetNavigationData
protected static void SetNavigationData(NavigationData navigationData, NavigationContext navigationContext)
{
navigationContext.SetContextVariable(Consts.KEY_NAVIGATION_DATA, navigationData);
}
示例3: 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;
}
示例4: SetMode
protected internal static void SetMode(string mode, NavigationContext context)
{
if (context == null)
return;
context.SetContextVariable(Consts.KEY_NAVIGATION_MODE, mode);
}
示例5: updateState
void updateState(NavigationContext context)
{
bool updateList = false;
navigationData = GetNavigationData(context);
if (context.WorkflowState.StateId == Guids.ViewItemsState && (navigationData == null || navigationData.StartupState != startupState))
{
updateList = true;
navigationData = getStartupNavigationData();
context.SetContextVariable(NavigationData.NAVIGATION_DATA, navigationData);
}
if (navigationData != null)
{
Header = navigationData.DisplayName;
ItemsList items = Items;
if (items != null && updateList)
{
items.Clear();
foreach (ListItem item in navigationData.ItemsList)
items.Add(item);
items.FireChange();
}
else
{
items = new ItemsList();
foreach (ListItem item in navigationData.ItemsList)
items.Add(item);
Items = items;
}
}
}