private void propertiesMenu_Click(object sender, EventArgs e) { if (controller.CanChangeCourseProperties()) { // Initialize the dialog AddCourse addCourseDialog = new AddCourse(); InitializeCoursePropertiesDialogWithCurrentValues(addCourseDialog); addCourseDialog.SetTitle(MiscText.CoursePropertiesTitle); addCourseDialog.HelpTopic = "CourseProperties.htm"; // Display the dialog DialogResult result = addCourseDialog.ShowDialog(); // If the dialog completed successfully, then change the course. if (result == DialogResult.OK) { controller.ChangeCurrentCourseProperties(addCourseDialog.CourseKind, addCourseDialog.CourseName, addCourseDialog.ControlLabelKind, addCourseDialog.ScoreColumn, addCourseDialog.SecondaryTitle, addCourseDialog.PrintScale, addCourseDialog.Climb, addCourseDialog.Length, addCourseDialog.DescKind, addCourseDialog.FirstControlOrdinal); } } else { // Change properties of all controls. float printScale; DescriptionKind descKind; controller.GetAllControlsProperties(out printScale, out descKind); // Initialize the dialog AllControlsProperties allControlsDialog = new AllControlsProperties(); allControlsDialog.InitializePrintScales(controller.MapScale); allControlsDialog.PrintScale = printScale; allControlsDialog.DescKind = descKind; // Display the dialog DialogResult result = allControlsDialog.ShowDialog(); // If the dialog completed successfully, then change the course. if (result == DialogResult.OK) { controller.ChangeAllControlsProperties(allControlsDialog.PrintScale, allControlsDialog.DescKind); } } }
private void addCourseMenu_Click(object sender, EventArgs e) { // Initialize the dialog, use all controls print scale as the default print scale. DescriptionKind allControlsDescKind; float allControlsPrintScale; controller.GetAllControlsProperties(out allControlsPrintScale, out allControlsDescKind); AddCourse addCourseDialog = new AddCourse(); addCourseDialog.HelpTopic = "CourseAddCourse.htm"; addCourseDialog.InitializePrintScales(controller.MapScale); addCourseDialog.PrintScale = allControlsPrintScale; // Display the dialog DialogResult result = addCourseDialog.ShowDialog(); // If the dialog completed successfully, then add the course. if (result == DialogResult.OK) { controller.NewCourse(addCourseDialog.CourseKind, addCourseDialog.CourseName, addCourseDialog.ControlLabelKind, addCourseDialog.ScoreColumn, addCourseDialog.SecondaryTitle, addCourseDialog.PrintScale, addCourseDialog.Climb, addCourseDialog.Length, addCourseDialog.DescKind, addCourseDialog.FirstControlOrdinal); } }
private void duplicateCourseMenu_Click(object sender, EventArgs e) { if (controller.CanDuplicateCurrentCourse()) { // Initialize the dialog AddCourse addCourseDialog = new AddCourse(); InitializeCoursePropertiesDialogWithCurrentValues(addCourseDialog); addCourseDialog.SetTitle(MiscText.DuplicateCourseTitle); addCourseDialog.HelpTopic = "CourseDuplicate.htm"; addCourseDialog.CourseName = ""; addCourseDialog.CanChangeCourseKind = false; // Display the dialog DialogResult result = addCourseDialog.ShowDialog(); // If the dialog completed successfully, then add the course. if (result == DialogResult.OK) { controller.DuplicateCurrentCourse(addCourseDialog.CourseName, addCourseDialog.ControlLabelKind, addCourseDialog.ScoreColumn, addCourseDialog.SecondaryTitle, addCourseDialog.PrintScale, addCourseDialog.Climb, addCourseDialog.Length, addCourseDialog.DescKind, addCourseDialog.FirstControlOrdinal); } } }