/// <summary> /// Resets the system. /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The event arguments</param> private void btnReset_Click(object sender, EventArgs e) { OurSystem.ResetSystem(); LblSysAge.Content = ""; LblSysName.Content = ""; OurSystem.SysStars.Clear(); StarTable.Clear(); LblNumberPlanets.Content = ""; PlanetTable.Clear(); }
/// <summary> /// This refreshes the DataGridView for displaying stars /// </summary> /// <summary> /// Begin Step 1 - generating the base system and stars, then displays them /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The event arguments</param> private void btnGenStars_Click(object sender, EventArgs e) { CreateStarsFinished = false; //clear the tables. if (OurSystem.CountStars() > 0) { OurSystem.ClearPlanets(); PlanetTable.Clear(); OurSystem.SysStars.Clear(); StarTable.Clear(); } var nCs = new CreateStars(OurSystem, VelvetBag, this); //register a closed event here. nCs.Closing += createStars_Closed; nCs.ShowDialog(); }