本文整理汇总了C#中MediaPortal.UI.Presentation.Workflow.NavigationContext类的典型用法代码示例。如果您正苦于以下问题:C# NavigationContext类的具体用法?C# NavigationContext怎么用?C# NavigationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationContext类属于MediaPortal.UI.Presentation.Workflow命名空间,在下文中一共展示了NavigationContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CanEnterState
public bool CanEnterState(NavigationContext oldContext, NavigationContext newContext)
{
lock (syncObject)
{
return currentBackgroundTask == null;
}
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:7,代码来源:SiteUpdateWorkflowModels.cs
示例2: UpdateNavigationItems
protected static ItemsList UpdateNavigationItems(NavigationContext context)
{
try
{
ItemsList navigationItems = GetOrCreateNavigationItems(context);
Stack<NavigationContext> contextStack = ServiceRegistration.Get<IWorkflowManager>().NavigationContextStack;
List<NavigationContext> contexts = new List<NavigationContext>(contextStack);
contexts.Reverse();
navigationItems.Clear();
bool first = true;
foreach (NavigationContext ctx in contexts)
{
ListItem item = new ListItem(KEY_NAME, ctx.DisplayLabel);
item.AdditionalProperties[KEY_ISFIRST] = first;
NavigationContext contextCopy = ctx;
item.Command = new MethodDelegateCommand(() => WorkflowPopToState(contextCopy.WorkflowState.StateId));
first = false;
navigationItems.Add(item);
}
navigationItems.FireChange();
return navigationItems;
}
catch (Exception e)
{
ServiceRegistration.Get<ILogger>().Warn("WorkflowNavigationBar: Error updating properties", e);
return null;
}
}
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:28,代码来源:WorkflowNavigationBar.cs
示例3: closeDialog
void closeDialog(NavigationContext context)
{
currentBackgroundTask = null;
var screenMgr = ServiceRegistration.Get<IScreenManager>();
if (screenMgr.TopmostDialogInstanceId == context.DialogInstanceId)
screenMgr.CloseTopmostDialog();
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:7,代码来源:ProgressDialogModel.cs
示例4: EnterModelContext
public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
{
// reset the properties
UpdateInfo = string.Empty;
UpdateProgress = 0;
// start the update in a background thread
RunUpdate(newContext);
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:8,代码来源:SiteUpdateWorkflowModels.cs
示例5: getParameters
bool getParameters(NavigationContext context)
{
game = null;
object gameObject;
if (!context.ContextVariables.TryGetValue(KEY_GAME, out gameObject))
return false;
game = gameObject as Game;
return game != null;
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:9,代码来源:GameLauncherDialog.cs
示例6: GetOrCreateNavigationItems
protected static ItemsList GetOrCreateNavigationItems(NavigationContext context)
{
lock (context.SyncRoot)
{
ItemsList result = GetNavigationItems(context);
if (result == null)
context.ContextVariables[NAVIGATION_ITEMS_KEY] = result = new ItemsList();
return result;
}
}
开发者ID:VicDemented,项目名称:MediaPortal-2,代码行数:10,代码来源:WorkflowNavigationBar.cs
示例7: DoTask
protected override void DoTask(NavigationContext context)
{
if (!getParameters(context))
return;
SetProgress("Launching " + game.Title, 0);
launcher = new GameLauncher(game);
launcher.ExtractionProgress += (s, e) => SetProgress(string.Format("Extracting {0}%", e.Percent), e.Percent);
launcher.Starting += (s, e) => SetProgress("Launching...", 50);
launcher.Exited += launcher_Exited;
launcher.Launch();
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:11,代码来源:GameLauncherDialog.cs
示例8: NavigationContext
/// <summary>
/// This constructor has to be called from the component managing the navigation context stack.
/// </summary>
public NavigationContext(WorkflowState workflowState, string displayLabel, NavigationContext predecessor,
IWorkflowModel workflowModel)
{
_workflowState = workflowState;
_displayLabel = displayLabel;
_predecessor = predecessor;
if (workflowModel != null)
{
_workflowModelId = workflowModel.ModelId;
_models.Add(workflowModel.ModelId, workflowModel);
}
}
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:15,代码来源:NavigationContext.cs
示例9: ExitModelContext
public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext)
{
// set a flag to stop the update if the thread is still running
lock (syncObject)
{
if (currentBackgroundTask != null) currentBackgroundTask.State = WorkState.CANCELED;
}
// wait until the update background thread has ended
while (currentBackgroundTask != null)
{
System.Threading.Thread.Sleep(20);
}
}
开发者ID:offbyoneBB,项目名称:mp-onlinevideos2,代码行数:13,代码来源:SiteUpdateWorkflowModels.cs
示例10: IsActionEnabled
public bool IsActionEnabled(NavigationContext context)
{
if (context.WorkflowModelId == Guids.WorkFlowModelOV)
{
if (!BackgroundTask.Instance.IsExecuting)
{
if (context.WorkflowState.Name == Guids.WorkflowStateCategoriesName || context.WorkflowState.StateId == Guids.WorkflowStateVideos)
{
return ((OnlineVideosWorkflowModel)context.Models[context.WorkflowModelId.Value]).SelectedSite.Site.CanSearch;
}
}
}
return false;
}
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:14,代码来源:SearchAction.cs
示例11: DoTask
protected override void DoTask(NavigationContext context)
{
if (!getParameters(context))
return;
SetProgress(string.Format("Looking up {0}", platformStr), 0);
var platform = importer.GetPlatformByName(platformStr);
if (platform != null)
{
SetProgress(string.Format("Retrieving info for {0}", platform.Name), 33);
var platformInfo = importer.GetPlatformInfo(platform.Id);
if (platformInfo != null)
{
System.Threading.Thread.Sleep(2000);
SetProgress(string.Format("Updating {0}", emulator.Title), 67);
emulator.Title = platformInfo.Title;
emulator.Developer = platformInfo.Developer;
emulator.Description = platformInfo.GetDescription();
using (ThumbGroup thumbGroup = new ThumbGroup(emulator))
{
using (SafeImage image = ImageHandler.SafeImageFromWeb(platformInfo.LogoUrl))
{
if (image != null)
{
thumbGroup.Logo.SetSafeImage(image.Image);
thumbGroup.SaveThumb(ThumbType.Logo);
}
}
using (SafeImage image = ImageHandler.SafeImageFromWeb(platformInfo.FanartUrl))
{
if (image != null)
{
thumbGroup.Fanart.SetSafeImage(image.Image);
thumbGroup.SaveThumb(ThumbType.Fanart);
}
}
}
emulator.Commit();
}
}
}
开发者ID:ministerkrister,项目名称:Emulators,代码行数:42,代码来源:PlatformDetailsModel.cs
示例12: OnStateSlotChanged
private static void OnStateSlotChanged(DependencyObject targetObject, NavigationContext context, string contextVariable)
{
if (string.IsNullOrEmpty(contextVariable))
{
WorkflowSaveRestoreStateAction action = GetSaveRestoreAction(targetObject);
if (action != null)
{
action.DetachFromObject();
RemoveSaveRestoreAction(targetObject);
}
}
else
{
if (GetSaveRestoreAction(targetObject) != null)
// Action already attached to object
return;
UIElement uiElement = targetObject as UIElement;
WorkflowSaveRestoreStateAction action = new WorkflowSaveRestoreStateAction(context, contextVariable);
SetSaveRestoreAction(targetObject, action);
action.AttachToObject(uiElement);
}
}
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:22,代码来源:WorkflowContext.cs
示例13: WorkflowSaveRestoreStateAction
public WorkflowSaveRestoreStateAction(NavigationContext context, string contextVariable)
{
_context = context;
_contextVariable = contextVariable;
}
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:5,代码来源:WorkflowSaveRestoreStateAction.cs
示例14: SendStatePushedMessage
public const string CONTEXT = "Context"; // Type: NavigationContext
/// <summary>
/// Sends a <see cref="MessageType.StatePushed"/> message.
/// </summary>
/// <param name="context">Navigation context of the workflow state which was pushed onto the navigation context stack.</param>
public static void SendStatePushedMessage(NavigationContext context)
{
SystemMessage msg = new SystemMessage(MessageType.StatePushed);
msg.MessageData[CONTEXT] = context;
ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
}
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:12,代码来源:WorkflowManagerMessaging.cs
示例15: UpdateMenuActions
public void UpdateMenuActions(NavigationContext context, IDictionary<Guid, WorkflowAction> actions)
{
}
开发者ID:BigGranu,项目名称:Webradio_MP2,代码行数:3,代码来源:WebradioFilter.cs
示例16: Reactivate
public void Reactivate(NavigationContext oldContext, NavigationContext newContext)
{
}
开发者ID:BigGranu,项目名称:Webradio_MP2,代码行数:3,代码来源:WebradioFilter.cs
示例17: ExitModelContext
public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext)
{
}
开发者ID:BigGranu,项目名称:Webradio_MP2,代码行数:3,代码来源:WebradioFilter.cs
示例18: EnterModelContext
public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
{
Init();
}
开发者ID:BigGranu,项目名称:Webradio_MP2,代码行数:4,代码来源:WebradioFilter.cs
示例19: UpdateMenuActions
public void UpdateMenuActions(NavigationContext context, IDictionary<Guid, WorkflowAction> actions)
{
actions.Add(Consts.ACTION_ID_REIMPORT_ALL_SHARES,
new MethodCallAction(Consts.ACTION_ID_REIMPORT_ALL_SHARES, "ReImportAllShares", null,
LocalizationHelper.CreateResourceString(Consts.RES_REIMPORT_ALL_SHARES), MODEL_ID_IMPORTS, "ReImportAllShares"));
}
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:6,代码来源:SharesOverviewModel.cs
示例20: Deactivate
public void Deactivate(NavigationContext oldContext, NavigationContext newContext)
{
// Nothing to do here
}
开发者ID:jgauffin,项目名称:MediaPortal-2,代码行数:4,代码来源:SharesOverviewModel.cs
注:本文中的MediaPortal.UI.Presentation.Workflow.NavigationContext类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论