private void Form_FormClosed(object sender, FormClosedEventArgs e) { if (Simulation3D.IsActive) { Simulation3D.End(); } }
/// <summary> /// Prepare UI to load a new configuration. /// </summary> private void CleanUp() { this.buttonInitHTM.Enabled = true; this.EnableSteeringButtons(false); this.menuView3DSimulation.Enabled = false; this.menuProjectProperties.Enabled = true; if (Simulation3D.IsActive) { Simulation3D.End(); } }
private void buttonStopHTM_Click(object sender, EventArgs e) { //this._dialogResult = MessageBox.Show ( "If you proceed, current simulation (learning) will stop!\r\n" // + "You will be able to save and start a new simulation.", "Warning", MessageBoxButtons.OKCancel); this.DialogResult = System.Windows.Forms.DialogResult.OK; if (this._dialogResult == DialogResult.OK) { // Set flag initialization off this.SimulationInitialized = false; // Disable relevant buttons to reset this.EnableSteeringButtons(false); this.menuProjectProperties.Enabled = true; this.buttonInitHTM.Enabled = true; this.menuView3DSimulation.Enabled = false; Simulation3D.End(); } }