// Change the course print area. If "removeParts" is true, and the course is an all parts, // then remove print descriptions for each part. public static void ChangePrintArea(EventDB eventDB, CourseDesignator courseDesignator, bool removeParts, PrintArea printArea) { printArea = (PrintArea) printArea.Clone(); if (courseDesignator.IsAllControls) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.printArea = printArea; eventDB.ChangeEvent(e); } else { Course course = eventDB.GetCourse(courseDesignator.CourseId); course = (Course) course.Clone(); if (courseDesignator.AllParts) { course.printArea = printArea; if (removeParts) course.partPrintAreas = new Dictionary<int, PrintArea>(); } else { course.partPrintAreas[courseDesignator.Part] = printArea; } eventDB.ReplaceCourse(courseDesignator.CourseId, course); } }
// Set the punch card format for the event. public static void ChangePunchcardFormat(EventDB eventDB, PunchcardFormat punchcardFormat) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.punchcardFormat = (PunchcardFormat) punchcardFormat.Clone(); eventDB.ChangeEvent(e); }
// Change the event title. Seperate lines with "|". public static void ChangeEventTitle(EventDB eventDB, string newTitle) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.title = newTitle; eventDB.ChangeEvent(e); }
// Change the map scale. public static void ChangeMapScale(EventDB eventDB, float newScale) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.mapScale = newScale; eventDB.ChangeEvent(e); }
// Change the description language public static void ChangeDescriptionLanguage(EventDB eventDB, string newLangId) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.descriptionLangId = newLangId; eventDB.ChangeEvent(e); }
// Change the custom system text for the event. public static void ChangeCustomSymbolText(EventDB eventDB, Dictionary<string, List<SymbolText>> customSymbolText, Dictionary<string, bool> customSymbolKey) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.customSymbolText = Util.CopyDictionary(customSymbolText); e.customSymbolKey = Util.CopyDictionary(customSymbolKey); eventDB.ChangeEvent(e); }
// Set the course appearance for this event. public static void ChangeCourseAppearance(EventDB eventDB, CourseAppearance courseAppearance) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.courseAppearance = (CourseAppearance) courseAppearance.Clone(); eventDB.ChangeEvent(e); }
// Change the auto numbering options. public static void ChangeAutoNumbering(EventDB eventDB, int startCode, bool disallowInvertibleCodes) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.firstControlCode = startCode; e.disallowInvertibleCodes = disallowInvertibleCodes; eventDB.ChangeEvent(e); }
// Change the attributes of a all controls display. public static void ChangeAllControlsProperties(EventDB eventDB, float printScale, DescriptionKind descriptionKind) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.allControlsPrintScale = printScale; e.allControlsDescKind = descriptionKind; eventDB.ChangeEvent(e); }