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


C# NavigationContext.SetContextVariable方法代码示例

本文整理汇总了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);
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:16,代码来源:MediaNavigationModel.cs

示例2: SetNavigationData

 protected static void SetNavigationData(NavigationData navigationData, NavigationContext navigationContext)
 {
   navigationContext.SetContextVariable(Consts.KEY_NAVIGATION_DATA, navigationData);
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:4,代码来源:MediaNavigationModel.cs

示例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;
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:14,代码来源:ConfigurationModel.cs

示例4: SetMode

 protected internal static void SetMode(string mode, NavigationContext context)
 {
   if (context == null)
     return;
   context.SetContextVariable(Consts.KEY_NAVIGATION_MODE, mode);
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:6,代码来源:MediaNavigationModel.cs

示例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;
                }
            }
        }
开发者ID:ministerkrister,项目名称:Emulators,代码行数:31,代码来源:EmulatorsMainModel.cs


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