private void LearningTaskFinished(object sender, SchoolEventArgs e) { Invoke((MethodInvoker)(() => { UpdateTaskData(e.Task); })); }
private void UpdateTrainingUnitNumber(object sender, SchoolEventArgs e) { Invoke((MethodInvoker)(() => { labelTrainingUnitValue.Text = e.Task.CurrentNumberOfAttempts.ToString(); labelSuccessefulAttemptsValue.Text = e.Task.CurrentNumberOfSuccesses.ToString() + " / " + e.Task.NumberOfSuccessesRequired; } )); }
private void GoToNextTask(object sender, SchoolEventArgs e) { Invoke((MethodInvoker)(() => { m_currentRow++; m_stepOffset = (int)m_mainForm.SimulationHandler.SimulationStep; m_currentLtStopwatch = new Stopwatch(); m_currentLtStopwatch.Start(); HighlightCurrentTask(); })); }
private void VisualFormatChanged(object sender, SchoolEventArgs e) { Invoke((MethodInvoker)(() => { if (m_observer != null) { MyMemoryBlockObserver mbObserver = (m_observer.Observer as MyMemoryBlockObserver); switch (m_school.Format) { case SchoolWorld.VisualFormat.Raw: mbObserver.Method = RenderingMethod.Raw; break; case SchoolWorld.VisualFormat.RGB: mbObserver.Method = RenderingMethod.RGB; break; } } })); }
private void UpdateLTLevel(object sender, SchoolEventArgs e) { Invoke((MethodInvoker)(() => { if (tabControlLevels != null && tabControlLevels.TabCount > 0) { var focus = GetFocusedControl(); if (m_currentRow >= 0) { dataGridViewLearningTasks.Rows[m_currentRow].Selected = true; } tabControlLevels.SelectedIndex = m_school.Level - 1; labelCurrentLevelValue.Text = m_school.Level.ToString() + " / " + e.Task.NumberOfLevels; if (focus != null) { focus.Focus(); } (tabControlLevels.SelectedTab.Controls[0] as DataGridView).ClearSelection(); } })); }