private void SimStartControl_TextChanged(object sender, EventArgs e) { try { ScenarioComponent before = (ScenarioComponent)Scenario.Clone(); Scenario.SimParams.SimStart = Convert.ToDouble(SimStartControl.Text); ScenarioComponent after = (ScenarioComponent)Scenario.Clone(); if (before.ToXml() != after.ToXml()) { _mManager.RegisterEvent(before, after, Scenario, "Simulation Starttime Change"); } } catch (FormatException) { // Text box value not a double; ignore change MessageBox.Show("Text box value not in correct format"); } }
private void MaxSchedulesControl_TextChanged(object sender, EventArgs e) { try { ScenarioComponent before = (ScenarioComponent)Scenario.Clone(); Scenario.SchParams.MaxSchedules = Convert.ToInt32(MaxSchedulesControl.Text); ScenarioComponent after = (ScenarioComponent)Scenario.Clone(); if (before.ToXml() != after.ToXml()) { _mManager.RegisterEvent(before, after, Scenario, "Max Schedules Change"); } } catch (FormatException) { // Text box value not a double; ignore change MessageBox.Show("Text box value not in correct format"); } }