public SetTitle ( string titleText ) : void | ||
titleText | string | |
Résultat | void |
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 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); } } }