private void timeUsedUp() { this.timeControl.Stop(); MemorizeResultWindow resultWindow = new MemorizeResultWindow(); resultWindow.ShowDialog(); MemorizeDataMgr.Instance.Restart(); this.timeControl.Start(60); this.startStage(); }
private void showStageFeedback() { Thread.Sleep(200); // DoubleAnimation doubleAnimation = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromMilliseconds(300))); // doubleAnimation.Completed += (sender, e) => { this.Dispatcher.BeginInvoke(new ThreadStart(() => // if (MemorizeDataMgr.Instance.Entry.StageFeedback == null) { if (MemorizeDataMgr.Instance.IsLastStage) { MemorizeDataMgr.Instance.UsedTime = this.timeControl.Elapsed; this.timeControl.Stop(); MemorizeResultWindow resultWnd = new MemorizeResultWindow(); resultWnd.ShowDialog(); MemorizeDataMgr.Instance.Restart(); this.timeControl.Start(60); this.startStage(); } else { ResultWindow resultWnd = new ResultWindow(); resultWnd.State = ResultState.Pass; if (MemorizeDataMgr.Instance.CurrentChanllengeMode == ChanllengeMode.VsPC) { if (this.memorizeItemGrid.UserCorrectCount < this.memorizeItemGrid.BotCorrectCount) { resultWnd.State = ResultState.NotPass; } } else if (MemorizeDataMgr.Instance.CurrentChanllengeMode == ChanllengeMode.TwoPlayer) { StringBuilder message = new StringBuilder(); message.AppendLine(string.Format("{0}翻开了{1}组牌, {2}翻开了{3}组牌.", MemorizeDataMgr.Instance.PlayerAName, this.memorizeItemGrid.PlayerACorrectCount, MemorizeDataMgr.Instance.PlayerBName, this.memorizeItemGrid.PlayerBCorrectCount)); if (this.memorizeItemGrid.PlayerACorrectCount > this.memorizeItemGrid.PlayerBCorrectCount) { message.AppendLine(string.Format("{0}战胜了{1}.", MemorizeDataMgr.Instance.PlayerAName, MemorizeDataMgr.Instance.PlayerBName)); } else if (this.memorizeItemGrid.PlayerACorrectCount == this.memorizeItemGrid.PlayerBCorrectCount) { message.AppendLine(string.Format("{0}与{1}战成了平手.", MemorizeDataMgr.Instance.PlayerAName, MemorizeDataMgr.Instance.PlayerBName)); } else { message.AppendLine(string.Format("{0}战胜了{1}.", MemorizeDataMgr.Instance.PlayerBName, MemorizeDataMgr.Instance.PlayerAName)); } resultWnd.Message = message.ToString(); } resultWnd.ShowMessage((ok) => { if (ok) { MemorizeDataMgr.Instance.MoveToNextStage(); } this.startStage(); }); } }), DispatcherPriority.Normal, null); }; // this.backgroundImage.BeginAnimation(Image.OpacityProperty, doubleAnimation); }