/// <summary> /// Prints information about the current application. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Help(object sender, EventArgs e) { if (this.MdiChildren.Length > 0) { if (this.ActiveMdiChild.GetType() == typeof(formTextEditor)) { formTextEditor textEditorInstance = (formTextEditor)this.ActiveMdiChild; textEditorInstance.HelpAbout(sender, e); } else if (this.ActiveMdiChild.GetType() == typeof(AverageUnitsShipped)) { AverageUnitsShipped averageUnitsShippedInstance = (AverageUnitsShipped)this.ActiveMdiChild; averageUnitsShippedInstance.AverageUnitsShippedHelp(); } else if (this.ActiveMdiChild.GetType() == typeof(formAwesomeness)) { formAwesomeness awesomenessInstance = (formAwesomeness)this.ActiveMdiChild; awesomenessInstance.AwesomenessHelp(); } else if (this.ActiveMdiChild.GetType() == typeof(CarInventory)) { CarInventory carHelpInstance = (CarInventory)this.ActiveMdiChild; carHelpInstance.CarHelp(); } else { MessageBox.Show("The Help operation is not supported by the current selected window."); } } else { MessageBox.Show("Final Project\n" + "By Nimsith Fernandopulle and Gaelen Rhoads\n\n" + "For NETD 2202" + "\n" + "April 2021", "About this Application"); } }
/// <summary> /// Saves a file to the users computer for the first time. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FileSaveAs(object sender, EventArgs e) { if (this.MdiChildren.Length > 0) { if (this.ActiveMdiChild.GetType() == typeof(formTextEditor)) { formTextEditor textEditorInstance = (formTextEditor)this.ActiveMdiChild; textEditorInstance.FileSaveAs(sender, e); } else if (this.ActiveMdiChild.GetType() == typeof(AverageUnitsShipped)) { AverageUnitsShipped UnitsShippedInstance = (AverageUnitsShipped) this.ActiveMdiChild; MessageBox.Show("This application doesn’t support that functionality"); } else if (this.ActiveMdiChild.GetType() == typeof(CarInventory)) { CarInventory UnitsShippedInstance = (CarInventory) this.ActiveMdiChild; MessageBox.Show("This application doesn’t support that functionality"); } else if (this.ActiveMdiChild.GetType() == typeof(formAwesomeness)) { formAwesomeness UnitsShippedInstance = (formAwesomeness) this.ActiveMdiChild; MessageBox.Show("This application doesn’t support that functionality"); } } }
/// <summary> /// Opens the car list. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void WindowNewCarList(object sender, EventArgs e) { CarInventory myCarInventory = CarInventory.Instance; myCarInventory.MdiParent = this; myCarInventory.Show(); myCarInventory.Focus(); }
/// <summary> /// Resets the instance variable when the form closes. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CarInventoryClosing(object sender, FormClosingEventArgs e) { instance = null; }