private bool initForm(bool isClearParams) { bool r_inf = false; try { typingParams tP = typingParams.getInstance(); if (isClearParams == true) { long tick = tP.getTick(); int numOfplay = tP.getNumberOfPlayer(); /* 古いタイマはnullクリアしてGC対象にする */ if (disTimer != null) { disTimer = null; } disTimer = new DispatcherTimer(); disTimer.Interval = new TimeSpan(tick); disTimer.Tick += new EventHandler(distTimer_Tick); disTimer.Stop(); if (this.m_typing.getParamsFromInifile() == true) { if (this.m_typing.setTargetString() == true) { this.disTimer.Stop(); } } tP.incPlayCount(); } tP.clearPoolString(); this.label1.FontSize = 60; this.label1.Content = tP.getCurrentPlayerString(); if (tP.getGameMode() == typingParams.GAME_MODE.CHAMPION_MODE) { this.label1.Foreground = new SolidColorBrush(Colors.Red); this.label1.FontWeight = FontWeights.ExtraBold; this.label1.Content += " Try!!!\nHit Space key!"; } else { this.label1.Foreground = new SolidColorBrush(Colors.Blue); this.label1.FontWeight = FontWeights.Normal; this.label1.Content += " Player\nHit Space key!"; } this.label2.Content = ""; this.label4.Content = ""; r_inf = true; } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } return(r_inf); }
private void NormalMouseMove(object sender, MouseEventArgs e) { typingParams tP = typingParams.getInstance(); label7.Foreground = new SolidColorBrush(Colors.Aqua); this.label1.Foreground = new SolidColorBrush(Colors.Blue); this.label1.FontWeight = FontWeights.Normal; this.label1.Content = tP.getCurrentPlayerString() + " Player\nHit Space key!"; this.label5.Content = tP.getGameModeString(); }