private void uxUpdateBtn_Click(object sender, EventArgs e) { // This sometimes breaks try { // Disable the updateTimer or it may break the m_Action.Update updateTimer.Enabled = false; // update the parameters of the ActionObject m_Action.Update(uxTimeOfAction.Text, uxEndOfAction.Text); // We MUST disable the blinktimer, to ensure it is not blinking right now blinkTimer.Enabled = false; m_BlinkTrack = 0; m_BlinkRunning = false; // Update the screen with current values uxTimeOfAction.Text = m_Action.StartOffset.ToString(); uxEndOfAction.Text = m_Action.Length.ToString(); // Make sure the screen has a black background m_Action.Background_Start = Color.Black; m_Action.Background_End = Color.Black; // re-enable the update timer, it can tick now. updateTimer.Enabled = true; } catch { // Something went wrong, throw an alert, and increase the errorcount m_ErrorCount++; if (m_ErrorCount >= m_MaxError) { killControl(); } MessageBox.Show("Error in actionClockControl, uxUpdateBtn_Click"); } }
private void uxUpdateBtn_Click(object sender, EventArgs e) { try { updateTimer.Enabled = false; m_Action.Update(uxTimeOfAction.Text, uxEndOfAction.Text); blinkTimer.Enabled = false; m_BlinkTrack = 0; m_BlinkRunning = false; uxTimeOfAction.Text = m_Action.StartOffset.ToString(); uxEndOfAction.Text = m_Action.Length.ToString(); m_Action.Background_Start = Color.Black; m_Action.Background_End = Color.Black; updateTimer.Enabled = true; } catch { MessageBox.Show("Error in uxFullSingleTimer, uxUpdateBtn_Click"); } }