private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //註銷掉事件 bodyFrameReader.FrameArrived -= BodyFrameReader_FrameArrived; _reader.MultiSourceFrameArrived -= _reader_MultiSourceFrameArrived; poseture.Poseture_List -= Success_Change_word; dispatcherTimer.Tick -= DispatcherTimer_Tick; dispatcherGameTimer.Tick -= GameTimer_Tick; QRcodeTimer.Tick -= QRCodeTimer_Tick; //關閉Socket.io連線 sokcet_Connect.SocketClose(); //Stop Text To Speech textToSpeech.SpeechPause(); //Stop SoundPlay SoundPlay.PlayStop(); //停止偵測QRCode QRcodeTimer.Stop(); //暫停拍照倒數時間 dispatcherTimer.Stop(); //將音效的狀態設定為初始值 PostureSoundStatus = false; if (_reader != null) { _reader.Dispose(); _reader = null; } if (bodyFrameReader != null) { bodyFrameReader.Dispose(); bodyFrameReader = null; } if (null != this.convertStream) { this.convertStream.SpeechActive = false; } if (null != this.speechEngine) { this.speechEngine.SpeechRecognized -= this.SpeechRecognized; this.speechEngine.SpeechRecognitionRejected -= this.SpeechRejected; this.speechEngine.RecognizeAsyncStop(); } PeerMainWidnow peerMainWidnow = new PeerMainWidnow(); peerMainWidnow.Show(); }
private void BtnLoginPeer_Click(object sender, RoutedEventArgs e) { if (!String.IsNullOrEmpty(txtBoxLogin.Text)) { Students.Group = "Peer"; Students.StudentsName = txtBoxLogin.Text.Trim(); PeerMainWidnow peerMainWidnow = new PeerMainWidnow(); peerMainWidnow.Show(); this.Close(); } }