/// <summary> /// Remove a pushed screen from the queue because it is no longer necessary /// </summary> public void RemovePush(IWorkspaceModule module, IModuleWorkspace workspace) { _pushedScreens.RemoveAll(pair => pair.Module == module && pair.Workspace == workspace); // If the current screen was part of the removed screens go back in history if (!_pushedScreens.Contains(Current)) { MovePrevious(); } }
/// <summary> /// Push a module onto the history stack with a specific screen /// </summary> public void Push(IWorkspaceModule module, IModuleWorkspace workspace) { if (_history.Count >= HistoryLength) { var pair = _history.ElementAt(0); pair.Module.DestroyWorkspace(pair.Workspace); _history.Remove(pair); } Push(new WorkspacePair(module, workspace)); }
/// <summary> /// Module tries to push itself onto the stack as result of a server side notification /// </summary> /// <returns>True if screen was pushed - false if enqueued!</returns> public bool TryPush(IWorkspaceModule module, IModuleWorkspace workspace) { var pushedPair = new WorkspacePair(module, workspace); if (Current.Workspace.CurrentInteraction != WorkspaceInteraction.Idle) { _pushedScreens.Add(pushedPair); return(false); } // Current screen idles - so just push Push(pushedPair); return(true); }
/// <summary> /// Fill event args with workspace change arguments /// </summary> public WorkspacePair(IWorkspaceModule module, IModuleWorkspace workspace) { Module = module; Workspace = workspace; }
public HistoryWriter(IWorkspaceModule module, IHistory history) { _module = module; _history = history; }
/// <inheritdoc /> public ModuleWrapper(IWorkspaceModule module) { Module = module; }
/// <summary> /// Push a module onto the history stack with a default screen /// </summary> public void Push(IWorkspaceModule module) { Push(module, module.CreateWorkspace()); }