void _dictaphone_ChangeState(object sender, DictaphoneStateEventArgs e) { _dictaphone_state = e.State; if (e.State == DictaphoneState.Initial) lblTime.Text = string.Format(timeFormat, "0"); }
void dict_ChangeState(object sender, DictaphoneStateEventArgs e) { switch (e.State) { case DictaphoneState.Initial: lblTime.Text = string.Format(timeFormat, 0); btnStop.Enabled = false; btnPause.Enabled = false; btnPlay.Enabled = true; gbSetup.Enabled = true; gbRecorder.Enabled = true; btnStopRec.Enabled = false; btnPauseRec.Enabled = false; btnRec.Enabled = true; btnPlay.Enabled = true; gbSetup.Enabled = true; gbPlayer.Enabled = true; break; case DictaphoneState.PausePlay: btnPause.Enabled = false; btnPlay.Enabled = true; break; case DictaphoneState.Play: btnPlay.Enabled = false; btnPause.Enabled = true; btnStop.Enabled = true; btnRec.Enabled = false; gbSetup.Enabled = false; gbRecorder.Enabled = false; break; case DictaphoneState.PauseRecord: btnPauseRec.Enabled = false; btnRec.Enabled = true; btnStopRec.Enabled = true; break; case DictaphoneState.Record: btnStopRec.Enabled = true; btnPauseRec.Enabled = true; btnRec.Enabled = false; gbSetup.Enabled = false; gbPlayer.Enabled = false; break; default: break; } }
void dict_ChangeState(object sender, DictaphoneStateEventArgs e) { switch (e.State) { case DictaphoneState.Initial: lblTime.Text = string.Format(_timeFormat, 0); setEnableForEverythingThatCanAffectSound(true); checkDictaphoneCallBack(); break; case DictaphoneState.PausePlay: throw new Exception("Please implement the dict_ChangeState handler"); break; case DictaphoneState.Play: setEnableForEverythingThatCanAffectSound(false); btnStop.Enabled = true; btnPlayQuestion.Enabled = true; btnShowAnswer.Enabled = true; break; case DictaphoneState.PauseRecord: throw new Exception("Please implement the dict_ChangeState handler"); break; case DictaphoneState.Record: setEnableForEverythingThatCanAffectSound(false); btnStopRec.Enabled = true; break; default: break; } }