本文整理汇总了C#中PurplePen.EventDB类的典型用法代码示例。如果您正苦于以下问题:C# EventDB类的具体用法?C# EventDB怎么用?C# EventDB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventDB类属于PurplePen命名空间,在下文中一共展示了EventDB类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteXml
public void WriteXml(string filename, RelayVariations relayVariations, EventDB eventDB, Id<Course> courseId)
{
this.relayVariations = relayVariations;
this.eventDB = eventDB;
this.courseId = courseId;
this.modificationDate = DateTimeOffset.Now;
this.courseName = eventDB.GetCourse(courseId).name;
// Create the XML writer.
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.Encoding = new UTF8Encoding(false);
xmlWriter = XmlWriter.Create(filename, settings);
WriteStart();
for (int teamNumber = 1; teamNumber < relayVariations.NumberOfTeams; ++teamNumber) {
WriteTeam(teamNumber);
}
WriteEnd();
// And done.
xmlWriter.Close();
eventDB = null;
xmlWriter = null;
}
示例2: FormatCourseToLayout
// Format the given CourseView into a bunch of course objects, and add it to the given course Layout
public RectangleF FormatCourseToLayout(SymbolDB symbolDB, CourseView courseViewAllVariations, CourseView specificVariation, CourseLayout courseLayout, CourseLayer layerAllVariations, CourseLayer layerSpecificVariation)
{
this.eventDB = courseViewAllVariations.EventDB;
this.symbolDB = symbolDB;
this.courseLayout = courseLayout;
this.courseLayerAllVariationsAndParts = layerAllVariations;
this.courseLayerSpecificVariation = layerSpecificVariation;
this.controlViewsAllVariationsAndParts = courseViewAllVariations.ControlViews;
this.controlViewsSpecificVariation = specificVariation.ControlViews;
this.controlPositions = new ControlPosition[controlViewsAllVariationsAndParts.Count];
this.courseControlIdsSpecificVariation = QueryEvent.EnumCourseControlIds(eventDB, specificVariation.CourseDesignator).ToArray();
this.variationMap = QueryEvent.GetVariantCodeMapping(eventDB, courseViewAllVariations.CourseDesignator);
SizeF totalAbstractSize = AssignControlPositions(0, controlViewsAllVariationsAndParts.Count, 0, 0);
// Now create objects now that the positions have been created.
scaleRatio = 1.0F;
appearance = new CourseAppearance();
for (int index = 0; index < controlViewsAllVariationsAndParts.Count; ++index) {
CreateObjectsForControlView(controlViewsAllVariationsAndParts[index], controlPositions[index]);
}
PointF bottomCenter = LocationFromAbstractPosition(0, 0);
SizeF size = SizeFromAbstractSize(totalAbstractSize);
RectangleF rect = new RectangleF(bottomCenter.X - size.Width / 2, bottomCenter.Y - size.Height, size.Width, size.Height);
rect.Inflate(widthUnit, heightUnit);
return rect;
}
示例3: DescriptionPrinting
public DescriptionPrinting(EventDB eventDB, SymbolDB symbolDB, Controller controller, DescriptionPrintSettings descPrintSettings)
: base(QueryEvent.GetEventTitle(eventDB, " "), controller, descPrintSettings.PageSettings, descPrintSettings.BoxSize, descPrintSettings.CountKind, descPrintSettings.Count)
{
this.eventDB = eventDB;
this.symbolDB = symbolDB;
this.descPrintSettings = descPrintSettings;
}
示例4: AddCourseControl
// Add a new course control to a course. Adds a new CourseControl referencing controlId into courseId. The place to insert is
// given by courseControl1 and courseControl2. These control should have been gotten by calling FindControlInsertionPoint.
public static Id<CourseControl> AddCourseControl(EventDB eventDB, Id<ControlPoint> controlId, Id<Course> courseId, Id<CourseControl> courseControl1, Id<CourseControl> courseControl2)
{
CourseControl newCourseControl;
Id<CourseControl> newCourseControlId;
// When adding a new course controls, they fit into variations fine because we are never adding or changing an split, just
// fitting into existing splits.
if (courseControl1.IsNone) {
// Adding at start.
Course course = (Course) eventDB.GetCourse(courseId).Clone();
Debug.Assert(courseControl2 == course.firstCourseControl);
newCourseControl = new CourseControl(controlId, course.firstCourseControl);
newCourseControlId = eventDB.AddCourseControl(newCourseControl);
course.firstCourseControl = newCourseControlId;
eventDB.ReplaceCourse(courseId, course);
}
else {
// Adding after courseControl1.
CourseControl before = (CourseControl) eventDB.GetCourseControl(courseControl1).Clone();
Debug.Assert(courseControl2 == before.nextCourseControl);
newCourseControl = new CourseControl(controlId, before.nextCourseControl);
newCourseControlId = eventDB.AddCourseControl(newCourseControl);
before.nextCourseControl = newCourseControlId;
eventDB.ReplaceCourseControl(courseControl1, before);
}
return newCourseControlId;
}
示例5: RelayVariations
public RelayVariations(EventDB eventDB, Id<Course> courseId, int numberTeams, int numberLegs)
{
this.eventDB = eventDB;
this.courseId = courseId;
this.numberTeams = numberTeams;
this.numberLegs = numberLegs;
}
示例6: PrintCourses
public PrintCourses(EventDB eventDB, bool enableMultipart)
{
InitializeComponent();
courseSelector.EventDB = eventDB;
checkBoxMergeParts.Visible = enableMultipart;
}
示例7: SelectVariations
public SelectVariations(EventDB eventDB, Id<Course> courseId)
{
InitializeComponent();
this.eventDB = eventDB;
this.courseId = courseId;
Course course = eventDB.GetCourse(courseId);
if (course.relayTeams > 0)
lastTeam = course.relayTeams;
else
lastTeam = null;
comboBoxVariations.SelectedIndex = 0;
if (lastTeam.HasValue) {
upDownFirstTeam.Maximum = upDownLastTeam.Maximum = lastTeam.Value;
upDownFirstTeam.Minimum = upDownLastTeam.Minimum = 1;
upDownFirstTeam.Value = 1;
upDownLastTeam.Value = lastTeam.Value;
labelNumberOfTeams.Text = string.Format(labelNumberOfTeams.Text, lastTeam.Value);
}
UpdateControls();
}
示例8: OcadCreation
public OcadCreation(SymbolDB symbolDB, EventDB eventDB, Controller controller, CourseAppearance courseAppearance, OcadCreationSettings creationSettings)
{
this.symbolDB = symbolDB;
this.eventDB = eventDB;
this.controller = controller;
this.courseAppearance = courseAppearance;
this.creationSettings = creationSettings;
}
示例9: ExportRouteGadget
public ExportRouteGadget(SymbolDB symbolDB, EventDB eventDB, MapDisplay mapDisplay)
{
this.symbolDB = symbolDB;
this.eventDB = eventDB;
this.mapDisplay = mapDisplay.CloneToFullIntensity();
this.mapDisplay.SetCourse(null);
this.mapDisplay.SetPrintArea(null);
}
示例10: AllCoursesHaveLoads
// Do all courses have loads set?
public static bool AllCoursesHaveLoads(EventDB eventDB)
{
foreach (Course course in eventDB.AllCourses) {
if (course.load < 0)
return false;
}
return true;
}
示例11: AddRectangleMode
public AddRectangleMode(Controller controller, UndoMgr undoMgr, SelectionMgr selectionMgr, EventDB eventDB, float aspectRatio, Func<RectangleF, CourseObj> createCourseObj, Func<RectangleF, Id<Special>> createSpecial)
{
this.controller = controller;
this.undoMgr = undoMgr;
this.selectionMgr = selectionMgr;
this.eventDB = eventDB;
this.aspectRatio = aspectRatio;
this.createCourseObj = createCourseObj;
this.createSpecial = createSpecial;
}
示例12: AllVariationsOfCourseControl
// If a course control is the beginning of a variation split, return all course controls assigned to that variation split.
// Otherwise, return just that course control.
public static IEnumerable<Id<CourseControl>> AllVariationsOfCourseControl(EventDB eventDB, Id<CourseControl> courseControlId)
{
CourseControl courseControl = eventDB.GetCourseControl(courseControlId);
if (courseControl.split) {
return courseControl.splitCourseControls;
}
else {
return new[] { courseControlId };
}
}
示例13: TopologyDragControlMode
public TopologyDragControlMode(Controller controller, EventDB eventDB, SelectionMgr selectionMgr, CourseObj courseObject, PointF startDrag, PointF currentLocation)
{
this.controller = controller;
this.eventDB = eventDB;
this.selectionMgr = selectionMgr;
this.courseObjectStart = courseObject;
this.courseObjectDrag = (CourseObj)(courseObject.Clone());
this.startDrag = startDrag;
this.currentLocation = currentLocation;
this.dropTargetHighlight = null;
}
示例14: AddDescriptionMode
public AddDescriptionMode(Controller controller, UndoMgr undoMgr, SelectionMgr selectionMgr, EventDB eventDB, SymbolDB symbolDB, CourseDesignator courseDesignator, DescriptionLine[] description, DescriptionKind kind)
{
this.controller = controller;
this.undoMgr = undoMgr;
this.selectionMgr = selectionMgr;
this.symbolDB = symbolDB;
this.eventDB = eventDB;
this.courseDesignator = courseDesignator;
this.description = description;
this.kind = kind;
}
示例15: AddControlMode
public AddControlMode(Controller controller, SelectionMgr selectionMgr, UndoMgr undoMgr, EventDB eventDB, SymbolDB symbolDB, bool allControls, ControlPointKind controlKind, bool exchangeAtControl)
{
this.controller = controller;
this.selectionMgr = selectionMgr;
this.undoMgr = undoMgr;
this.eventDB = eventDB;
this.symbolDB = symbolDB;
this.allControls = allControls;
this.controlKind = controlKind;
this.exchangeAtControl = exchangeAtControl;
this.scaleRatio = selectionMgr.ActiveCourseView.ScaleRatio;
this.appearance = controller.GetCourseAppearance();
}