public void Execute(Transition transition) { this.transitions.Add(transition); if (!this.running) { this.taskResult = Executors.RunOnCoroutine(this.DoTask()); } }
public void Shutdown() { if (this.taskResult != null) { this.taskResult.Cancel(); this.running = false; this.taskResult = null; } this.transitions.Clear(); }
public void Execute(Transition transition) { try { if (transition is ShowTransition && transition.Window.WindowType == WindowType.QUEUED_POPUP) { int index = this.transitions.FindLastIndex((t) => (t is ShowTransition) && t.Window.WindowType == WindowType.QUEUED_POPUP && t.Window.WindowManager == transition.Window.WindowManager && t.Window.WindowPriority >= transition.Window.WindowPriority); if (index >= 0) { this.transitions.Insert(index + 1, transition); return; } index = this.transitions.FindIndex((t) => (t is ShowTransition) && t.Window.WindowType == WindowType.QUEUED_POPUP && t.Window.WindowManager == transition.Window.WindowManager && t.Window.WindowPriority < transition.Window.WindowPriority); if (index >= 0) { this.transitions.Insert(index, transition); return; } } this.transitions.Add(transition); } finally { if (!this.running) { taskResult = Executors.RunOnCoroutine(this.DoTask()); } } }
protected virtual IEnumerator DoTask() { try { this.running = true; yield return(null);//wait one frame while (this.transitions.Count > 0) { Transition transition = this.transitions.Find(e => Check(e)); if (transition != null) { this.transitions.Remove(transition); var result = Executors.RunOnCoroutine(transition.TransitionTask()); yield return(result.WaitForDone()); IWindowManager manager = transition.Window.WindowManager; var current = manager.Current; if (manager.Activated && current != null && !current.Activated && !this.transitions.Exists((e) => e.Window.WindowManager.Equals(manager))) { IAsyncResult activate = (current as IManageable).Activate(transition.AnimationDisabled); yield return(activate.WaitForDone()); } } else { yield return(null); } } } finally { this.running = false; this.taskResult = null; } }