当前位置: 首页>>代码示例>>C#>>正文


C# PurplePen.EventDB类代码示例

本文整理汇总了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;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:27,代码来源:ExportXml.cs

示例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;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:30,代码来源:TopologyFormatter.cs

示例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;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:7,代码来源:DescriptionPrinting.cs

示例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;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:31,代码来源:ChangeEvent.cs

示例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;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:7,代码来源:RelayVariations.cs

示例6: PrintCourses

        public PrintCourses(EventDB eventDB, bool enableMultipart)
        {
            InitializeComponent();
            courseSelector.EventDB = eventDB;

            checkBoxMergeParts.Visible = enableMultipart;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:7,代码来源:PrintCourses.cs

示例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();
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:25,代码来源:SelectVariations.cs

示例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;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:8,代码来源:OcadCreation.cs

示例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);
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:8,代码来源:ExportRouteGadget.cs

示例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;
        }
开发者ID:petergolde,项目名称:PurplePen,代码行数:10,代码来源:QueryEvent.cs

示例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;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:10,代码来源:AddImageMode.cs

示例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 };
     }
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:12,代码来源:QueryEvent.cs

示例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;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:11,代码来源:TopologyDragControlMode.cs

示例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;
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:11,代码来源:AddDescriptionMode.cs

示例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();
 }
开发者ID:petergolde,项目名称:PurplePen,代码行数:13,代码来源:AddControlMode.cs


注:本文中的PurplePen.EventDB类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。