本文整理汇总了C#中Course.UpdateUnknownPageSizes方法的典型用法代码示例。如果您正苦于以下问题:C# Course.UpdateUnknownPageSizes方法的具体用法?C# Course.UpdateUnknownPageSizes怎么用?C# Course.UpdateUnknownPageSizes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course.UpdateUnknownPageSizes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RoundTripCourses
public void RoundTripCourses()
{
UndoMgr undomgr = new UndoMgr(5);
EventDB eventDB = new EventDB(undomgr);
RectangleF mapBounds = new RectangleF(0, 0, 200, 300);
Course course1, course2, course3, course4, course5;
undomgr.BeginCommand(61, "Command1");
course1 = new Course(CourseKind.Normal, "White", 15000, 1);
course1.descKind = DescriptionKind.Symbols;
course1.secondaryTitle = "White is right";
course1.load = 0;
course1.firstCourseControl = CourseControlId(1);
course1.UpdateUnknownPageSizes(mapBounds, 15000);
eventDB.AddCourse(course1);
course2 = new Course(CourseKind.Normal, "Yellow", 15000, 2);
course2.descKind = DescriptionKind.SymbolsAndText;
course2.climb = 95;
course2.labelKind = ControlLabelKind.Code;
course2.firstCourseControl = CourseControlId(0);
course2.printArea = new PrintArea(false, true, new RectangleF(50, 70, 200, 100));
course2.partPrintAreas[1] = new PrintArea(false, false, new RectangleF(10, 20, 30, 40), 1.1F);
course2.partPrintAreas[0] = new PrintArea(true, false, new RectangleF(70, 10, 130, 140));
course2.partOptions[1] = new PartOptions() { ShowFinish = true };
course2.partOptions[0] = new PartOptions() { ShowFinish = false };
course2.relayTeams = 43;
course2.relayLegs = 3;
course2.UpdateUnknownPageSizes(mapBounds, 15000);
eventDB.AddCourse(course2);
course3 = new Course(CourseKind.Score, "Rambo", 10000, 3);
course3.secondaryTitle = "";
course3.firstCourseControl = CourseControlId(2);
course3.load = 125;
course3.climb = 0;
course3.firstControlOrdinal = 7;
course3.labelKind = ControlLabelKind.SequenceAndCode;
course3.descKind = DescriptionKind.Text;
course3.partPrintAreas[1] = new PrintArea(true, true, new RectangleF(-10, -20, 90, 80), 0.9F);
course3.UpdateUnknownPageSizes(mapBounds, 15000);
eventDB.AddCourse(course3);
course4 = new Course(CourseKind.Score, "Silly1", 10000, 3);
course4.secondaryTitle = "";
course4.firstCourseControl = CourseControlId(2);
course4.load = 0;
course4.climb = 25;
course4.overrideCourseLength = 4243;
course4.firstControlOrdinal = 3;
course4.labelKind = ControlLabelKind.SequenceAndScore;
course4.descKind = DescriptionKind.SymbolsAndText;
course4.partPrintAreas[1] = new PrintArea(false, false, new RectangleF(-10, -20, 90, 80));
course4.partOptions[1] = new PartOptions() { ShowFinish = false };
course4.relayTeams = 0;
course4.UpdateUnknownPageSizes(mapBounds, 15000);
eventDB.AddCourse(course4);
course5 = new Course(CourseKind.Score, "Silly2", 10000, 3);
course5.secondaryTitle = "";
course5.firstCourseControl = CourseControlId(2);
course5.load = 125;
course5.climb = 0;
course5.firstControlOrdinal = 1;
course5.labelKind = ControlLabelKind.CodeAndScore;
course5.descKind = DescriptionKind.Symbols;
course5.partPrintAreas[1] = new PrintArea(false, false, new RectangleF(-10, -20, 90, 80), 1.25F);
course5.relayTeams = 5;
course5.relayLegs = 6;
course5.UpdateUnknownPageSizes(mapBounds, 15000);
eventDB.AddCourse(course5);
undomgr.EndCommand(61);
eventDB.Save(TestUtil.GetTestFile("eventdb\\testoutput_temp.xml"));
undomgr.Clear();
eventDB = new EventDB(undomgr);
eventDB.Load(TestUtil.GetTestFile("eventdb\\testoutput_temp.xml"));
Assert.AreEqual(eventDB.GetCourse(CourseId(1)), course1);
Assert.AreEqual(eventDB.GetCourse(CourseId(2)), course2);
Assert.AreEqual(eventDB.GetCourse(CourseId(3)), course3);
Assert.AreEqual(eventDB.GetCourse(CourseId(4)), course4);
Assert.AreEqual(eventDB.GetCourse(CourseId(5)), course5);
TestUtil.TestEnumerableAnyOrder(eventDB.AllCoursePairs,
new KeyValuePair<Id<Course>, Course>[] {
new KeyValuePair<Id<Course>,Course>(CourseId(1), course1),
new KeyValuePair<Id<Course>,Course>(CourseId(2), course2),
new KeyValuePair<Id<Course>,Course>(CourseId(3), course3),
new KeyValuePair<Id<Course>,Course>(CourseId(4), course4),
new KeyValuePair<Id<Course>,Course>(CourseId(5), course5),
}
);
}