private void timerMain_Tick(object sender, EventArgs e) { if (context.PlayText.Length > 0) { try { expression = ExpressionFactory.CreateExpression(context.PlayText.Substring(0, 1),p); expression.Interpret(context); timerMain.Interval = p.Interval; } catch (Exception ex) { timerMain.Stop(); MessageBox.Show(ex.Message); } } else { timerMain.Stop(); } }
private void timerChord_Tick(object sender, EventArgs e) { if (context2.PlayText.Length > 0) { try { expression2 = ExpressionFactory.CreateExpression(context2.PlayText.Substring(0, 1), p2); expression2.Interpret(context2); timerChord.Interval = p2.Interval; } catch (Exception ex) { timerChord.Stop(); txtChord.Text = txtChord.Text.Replace(context2.PlayText, ""); MessageBox.Show(context2.PlayText); } } else { timerChord.Stop(); } }