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))) { IAsyncTask activate = (current as Window).Activate(transition.AnimationDisabled).Start(); yield return activate.WaitForDone(); } } else { yield return null; } } } finally { this.running = false; this.taskResult = null; } }
protected override IEnumerator DoTransition() { Window current = this.Window; if (this.manager.IndexOf(current) == 0) { if (current.Activated) { IAsyncTask passivate = current.Passivate(this.AnimationDisabled).Start(); yield return passivate.WaitForDone(); } if (current.Visibility) { IAsyncTask hide = current.DoHide(this.AnimationDisabled).Start(); yield return hide.WaitForDone(); } } else { if (current.Visibility) { IAsyncTask hide = current.DoHide(this.AnimationDisabled).Start(); yield return hide.WaitForDone(); } } if (dismiss) { current.DoDismiss(); } }
protected override IEnumerator DoTransition() { Window current = this.Window; int layer = (this.Layer < 0 || current.WindowType == WindowType.DIALOG || current.WindowType == WindowType.PROGRESS) ? 0 : this.Layer; if (layer > 0) { int visibleCount = this.manager.VisibleCount; if (layer > visibleCount) { layer = visibleCount; } } this.Layer = layer; Window previous = (Window)this.manager.GetVisibleWindow(layer);// this.manager.Current as Window; if (previous != null) { //Passivate the previous window if (previous.Activated) { IAsyncTask passivate = previous.Passivate(this.AnimationDisabled).Start(); yield return(passivate.WaitForDone()); } ActionType actionType = this.Overlay(previous, current); switch (actionType) { case ActionType.Hide: previous.DoHide(this.AnimationDisabled).Start(); break; case ActionType.Dismiss: previous.DoHide(this.AnimationDisabled).OnFinish(() => { previous.DoDismiss(); }).Start(); break; default: break; } } if (!current.Visibility) { IAsyncTask show = current.DoShow(this.AnimationDisabled).Start(); yield return(show.WaitForDone()); } if (this.manager.Activated && current.Equals(this.manager.Current)) { IAsyncTask activate = current.Activate(this.AnimationDisabled).Start(); yield return(activate.WaitForDone()); } }
protected override IEnumerator DoTransition() { Window current = this.Window; Window previous = this.manager.Current as Window; if (previous != null) { //Passivate the previous window if (previous.Activated) { IAsyncTask passivate = previous.Passivate(this.AnimationDisabled).Start(); yield return(passivate.WaitForDone()); } ActionType actionType = this.Overlay(previous, current); switch (actionType) { case ActionType.Hide: previous.DoHide(this.AnimationDisabled).Start(); break; case ActionType.Dismiss: previous.DoHide(this.AnimationDisabled).OnFinish(() => { previous.DoDismiss(); }).Start(); break; default: break; } } if (!current.Visibility) { IAsyncTask show = current.DoShow(this.AnimationDisabled).Start(); yield return(show.WaitForDone()); } if (this.manager.Activated && current.Equals(this.manager.Current)) { IAsyncTask activate = current.Activate(this.AnimationDisabled).Start(); yield return(activate.WaitForDone()); } }