public ActionResult Details(int?id) { if (id == null) { Response.Redirect("/error.html"); //return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Cours cours = db.Courses.Find(id); if (cours == null) { Response.Redirect("/error.html"); //return HttpNotFound(); } var userID = User.Identity.GetUserId(); CourseView cv = new CourseView(); var hasViewed = db.CourseViews.ToList() .Where(x => x.UserID == userID) .Where(x => x.CourseID == id).Count(); cv.UserID = userID; cv.CourseID = id ?? default(int); cv.DateViewed = DateTime.Now; if (hasViewed == 0) { db.CourseViews.Add(cv); db.SaveChanges(); } return(View(cours)); }
public ReturnState AddCourse(CourseView model) { ReturnState result; courseClient.AddCourse(model, out result, out specify); return(result); }
bool WriteCourse(Id <Course> courseId, int courseNumber) { // A course must have a start and a finish to be output. if (!QueryEvent.HasStartControl(eventDB, courseId)) { return(false); } if (!QueryEvent.HasFinishControl(eventDB, courseId)) { return(false); } Course course = eventDB.GetCourse(courseId); bool isScore = (course.kind == CourseKind.Score); string[] classNames = GetClassNames(eventDB, courseId); CourseView courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(courseId)); WriteCourseGroupStart(course.name, courseNumber, classNames, isScore); WriteCourseVariations(courseId, course.name, courseNumber, classNames, isScore); WriteCourseGroupEnd(); return(true); }
public void DisplayAllCourseViews() { UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); eventDB.Load(TestUtil.GetTestFile("courseview\\sampleevent1.coursescribe")); eventDB.Validate(); foreach (Id <Course> courseId in QueryEvent.SortedCourseIds(eventDB)) { CourseDesignator designator; if (QueryEvent.HasVariations(eventDB, courseId)) { var variationInfo = QueryEvent.GetAllVariations(eventDB, courseId).First(); designator = new CourseDesignator(courseId, variationInfo); } else { designator = new CourseDesignator(courseId); } CourseView courseView = CourseView.CreateViewingCourseView(eventDB, designator); DumpCourseView(courseView, Console.Out); Console.WriteLine(); } }
public void SpecialLegs() { UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); StringWriter writer = new StringWriter(); string actual, expected; eventDB.Load(TestUtil.GetTestFile("courseview\\speciallegs.coursescribe")); eventDB.Validate(); CourseView courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(CourseId(1))); DumpCourseView(courseView, writer); actual = writer.ToString(); expected = @"Name='Leggy', Kind='Normal', CourseId=1 Total Length=2242.8 Part Length=2242.8 Total Climb=-1 ScoreColumn=-1 Total Score=0 Total Controls=4 0: [ 0] Ids: 1, 1 Legs: (Next:1,Id:0,length:515.84) 1: [ 1] Ids: 2, 2 Legs: (Next:2,Id:2,length:420.12) 2: [ 2] Ids: 3, 3 Legs: (Next:3,Id:3,length:377.54) 3: [ 3] Ids: 4, 4 Legs: (Next:4,Id:4,length:518.8) 4: [ 4] Ids: 5, 5 Legs: (Next:5,Id:0,length:410.45) 5: [-1] Ids: 6, 6 "; Assert.AreEqual(expected, actual); }
public ActionResult Edit(CourseViewModels model) { var course = new CourseView(); courseClient.AddCourse(course); return(RedirectToAction("Index")); }
public bool AddCourseApply(CourseView model, UserApply user) { ReturnState result; courseClient.AddCourseApply(model, user, out result, out specify); return(result == ReturnState.ReturnOK); }
public void ClearTextAndSymbols() { UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); StringWriter writer = new StringWriter(); string actual, expected; eventDB.Load(TestUtil.GetTestFile("descformatter\\sampleevent1.coursescribe")); eventDB.Validate(); CourseView courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(CourseId(4))); DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting); DescriptionLine[] description = descFormatter.CreateDescription(false); DescriptionFormatter.ClearTextAndSymbols(description); DescriptionFormatter.DumpDescription(symbolDB, description, writer); actual = writer.ToString(); expected = @" | | | | | | ( 1) | | | | | | | | | ( 11) | | | | | | | | | ( 22) | : | ( 4) | | | | | | | | | ( 15) | : | ( 5) | | | | | | | | | ( 18) | | | | | | | | | ( 6) | : | "; Assert.AreEqual(expected, actual); }
// 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, Id <CourseControl> ccSelection1, Id <CourseControl> ccSelection2, 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.courseControlIdSelection1 = ccSelection1; this.courseControlIdSelection2 = ccSelection2; 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. courseObjRatio = 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); }
public void CourseEquals() { SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); CourseView courseView, courseView2; CourseLayout course, course2; eventDB.Load(TestUtil.GetTestFile("courselayout\\marymoor1.coursescribe")); eventDB.Validate(); // Create the a course view and layout courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(CourseId(3))); course = new CourseLayout(); course.SetLayerColor(CourseLayer.Descriptions, 0, "Black", 0, 0, 0, 1F, false); course.SetLayerColor(CourseLayer.MainCourse, 12, "Purple", 0.2F, 1, 0, 0.1F, false); CourseFormatter.FormatCourseToLayout(symbolDB, courseView, defaultCourseAppearance, course, CourseLayer.MainCourse); // Create it again courseView2 = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(CourseId(3))); course2 = new CourseLayout(); course2.SetLayerColor(CourseLayer.Descriptions, 0, "Black", 0, 0, 0, 1F, false); course2.SetLayerColor(CourseLayer.MainCourse, 12, "Purple", 0.2F, 1, 0, 0.1F, false); CourseFormatter.FormatCourseToLayout(symbolDB, courseView2, defaultCourseAppearance, course2, CourseLayer.MainCourse); // Make sure that they are equal. Assert.AreEqual(course, course, "CourseLayouts that are equivalent should compare equal."); Assert.AreEqual(course, course2, "CourseLayouts that are equivalent should compare equal."); }
// GET: Course/Details/5 public ActionResult Details(string token, string id) { string username = AuthLogic.CheckToken(token); if (username == "") { throw new Exception("NotAuthorized"); } ViewData["token"] = token; var course = Course.GetCourse(id); // cast to Subscribed CourseView courseView = CourseView.CastFromCourseModel(course.ModelCourse); if (courseView.Author == username) { ViewData["isAuthor"] = true; } else { ViewData["isAuthor"] = false; } ViewData["courseId"] = id; // return the subscribed one! return(View(courseView)); }
/// <summary> /// 分页查询 /// </summary> /// <param name="page"></param> /// <param name="nPage"></param> /// <returns></returns> public static List <CourseView> GetCourseByPage(int page, int nPage = 10) { var retList = new List <CourseView>(); using (var conn = new SqlConnection(connectionString)) { conn.Open(); var cmdText = string.Format("select top {0} * from CourseSets where Id not in (select top {1} Id from CourseSets)", nPage, page * nPage); using (var cmd = new SqlCommand(cmdText, conn)) { var reader = cmd.ExecuteReader(); while (reader.Read()) { var course = new CourseView() { Code = Convert.ToString(reader.GetValue(0)), University = Convert.ToInt32(reader.GetValue(1)), Name = Convert.ToString(reader.GetValue(2)), Desp = Convert.ToString(reader.GetValue(3)), PicUrl = Convert.ToString(reader.GetValue(4)) }; retList.Add(course); } } return(retList); } }
private void BtnOpenCourseView(object sender, RoutedEventArgs e) { CourseView view = new CourseView(); view.Closing += CourseView_Closing; view.ShowDialog(); }
public static CourseView GetCourseByCode(string code) { CourseView ret = null; using (var conn = new SqlConnection(connectionString)) { conn.Open(); var cmdText = string.Format("select * from CourseSets where Id = N'{0}'", code); using (var cmd = new SqlCommand(cmdText, conn)) { var reader = cmd.ExecuteReader(); while (reader.Read()) { var course = new CourseView() { Code = Convert.ToString(reader.GetValue(0)), University = Convert.ToInt32(reader.GetValue(1)), Name = Convert.ToString(reader.GetValue(2)), Desp = Convert.ToString(reader.GetValue(3)), PicUrl = Convert.ToString(reader.GetValue(4)) }; ret = course; } } return(ret); } }
public CourseView InitialApp() { Courses = JsonConvert.DeserializeObject <List <Course> >(DbHelper.GetCourses()); CourseView courseView = new CourseView(Courses); return(courseView); }
// Create a single PDF file void CreateOneBitmap(string fileName, CourseDesignator courseDesignator) { RectangleF mapRectangle = controller.GetCurrentPrintAreaRectangle(courseDesignator); // Get the course view for the course we are printing. CourseView courseView = CourseView.CreatePrintingCourseView(eventDB, courseDesignator); // Get the correct purple color to print the course in. short ocadId; float purpleC, purpleM, purpleY, purpleK; bool purpleOverprint; FindPurple.GetPurpleColor(mapDisplay, appearance, out ocadId, out purpleC, out purpleM, out purpleY, out purpleK, out purpleOverprint); // Create a course layout from the view. CourseLayout layout = new CourseLayout(); layout.SetLayerColor(CourseLayer.Descriptions, NormalCourseAppearance.blackColorOcadId, NormalCourseAppearance.blackColorName, NormalCourseAppearance.blackColorC, NormalCourseAppearance.blackColorM, NormalCourseAppearance.blackColorY, NormalCourseAppearance.blackColorK, false); layout.SetLayerColor(CourseLayer.MainCourse, ocadId, NormalCourseAppearance.courseColorName, purpleC, purpleM, purpleY, purpleK, purpleOverprint); CourseFormatter.FormatCourseToLayout(symbolDB, courseView, appearance, layout, CourseLayer.MainCourse); // Set the course layout into the map display mapDisplay.SetCourse(layout); mapDisplay.SetPrintArea(null); ExportBitmap exportBitmap = new ExportBitmap(mapDisplay); exportBitmap.CreateBitmap(fileName, mapRectangle, GetImageFormat(), bitmapCreationSettings.Dpi, bitmapCreationSettings.WorldFile ? mapDisplay.CoordinateMapper : null); }
// Render the given course id (0 = all controls) and kind to a bitmap, and compare it to the saved version. internal void CheckRenderBitmap(string filename, Id <Course> id, DescriptionKind kind, int numColumns = 1) { SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); CourseView courseView; eventDB.Load(filename); eventDB.Validate(); courseView = CourseView.CreateViewingCourseView(eventDB, DesignatorFromCourseId(eventDB, id)); DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting); DescriptionLine[] description = descFormatter.CreateDescription(kind == DescriptionKind.Symbols); Bitmap bmNew = DescriptionBrowser.RenderToBitmap(symbolDB, description, kind, numColumns); if (numColumns > 1) { TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "_" + numColumns + "col", kind)); } else { TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "", kind)); } }
// Render the given course id (0 = all controls) and kind to a map, and compare it to the saved version. internal void CheckRenderMapStandardChange(string filename, Id <Course> id, DescriptionKind kind, string newDescStandard) { SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); CourseView courseView; eventDB.Load(filename); symbolDB.Standard = eventDB.GetEvent().descriptionStandard; eventDB.Validate(); courseView = CourseView.CreateViewingCourseView(eventDB, DesignatorFromCourseId(eventDB, id)); DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting); DescriptionLine[] description = descFormatter.CreateDescription(kind == DescriptionKind.Symbols); Bitmap bmNew = RenderToMapThenToBitmap(symbolDB, description, kind, 1); TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "_std_default", kind)); undomgr.BeginCommand(71231, "change standard"); symbolDB.Standard = newDescStandard; ChangeEvent.UpdateDescriptionToMatchStandard(eventDB, symbolDB); undomgr.EndCommand(71231); description = descFormatter.CreateDescription(kind == DescriptionKind.Symbols); bmNew = RenderToMapThenToBitmap(symbolDB, description, kind, 1); TestUtil.CheckBitmapsBase(bmNew, DescriptionBrowser.GetBitmapFileName(eventDB, id, "_std_" + newDescStandard, kind)); }
// Count controls in a course view that match a predicate. private static string CountControls(CourseView courseView, Predicate <Id <ControlPoint> > predicate) { string desc = ""; int[] count = new int[7]; foreach (CourseView.ControlView controlView in courseView.ControlViews) { if (predicate(controlView.controlId)) { ControlPoint control = courseView.EventDB.GetControl(controlView.controlId); if (control.kind == ControlPointKind.Normal || control.kind == ControlPointKind.Start || control.kind == ControlPointKind.Finish || control.kind == ControlPointKind.CrossingPoint || control.kind == ControlPointKind.MapExchange) { count[(int)control.kind] += 1; } } } // Add the counts of each control kind to a string. if (count[(int)ControlPointKind.Normal] > 0) { desc = AddCount(desc, count[(int)ControlPointKind.Normal], SelectionDescriptionText.Control_Singular, SelectionDescriptionText.Control_Plural); } if (count[(int)ControlPointKind.Start] > 0) { desc = AddCount(desc, count[(int)ControlPointKind.Start], SelectionDescriptionText.Start_Singular, SelectionDescriptionText.Start_Plural); } if (count[(int)ControlPointKind.Finish] > 0) { desc = AddCount(desc, count[(int)ControlPointKind.Finish], SelectionDescriptionText.Finish_Singular, SelectionDescriptionText.Finish_Plural); } if (count[(int)ControlPointKind.CrossingPoint] > 0) { desc = AddCount(desc, count[(int)ControlPointKind.CrossingPoint], SelectionDescriptionText.MandCrossing_Singular, SelectionDescriptionText.MandCrossing_Plural); } if (count[(int)ControlPointKind.MapExchange] > 0) { desc = AddCount(desc, count[(int)ControlPointKind.MapExchange], SelectionDescriptionText.MapExchange_Singular, SelectionDescriptionText.MapExchange_Plural); } if (count[(int)ControlPointKind.MapIssue] > 0) { desc = AddCount(desc, count[(int)ControlPointKind.MapIssue], SelectionDescriptionText.MapIssue_Singular, SelectionDescriptionText.MapIssue_Plural); } // If we didn't find anthing the count string will still be empty. if (desc == "") { desc = SelectionDescriptionText.None; } return(desc); }
public ReturnState AddCourse(CourseView model) { if (CourseOperator.HasMember(model.Code)) { return(ReturnState.ReturnError); } return(CourseOperator.AddCourse(model)); }
/// <summary> /// Map method /// </summary> /// <param name="courseView">courseView instance</param> /// <returns>Course instance (for BLL)</returns> public static Course Map(this CourseView courseView) { var resultCourse = courseView.MapFlat(); resultCourse.Theme = courseView.Theme.Map(); resultCourse.Students = courseView.Students.Select(x => x.MapFlat()).ToList(); resultCourse.Teacher = courseView.teacher.MapFlat(); return resultCourse; }
// Create a description formatter to format the given courseView. // Currently, the language for the text descriptions is taken from the language set for the event. It would be easy to make this // a parameter to the constructor (e.g., to allow printing in a different language), but this currently isn't required. public DescriptionFormatter(CourseView courseView, SymbolDB symbolDB, Purpose purpose) { this.courseView = courseView; this.eventDB = courseView.EventDB; this.symbolDB = symbolDB; this.language = QueryEvent.GetDescriptionLanguage(eventDB); this.purpose = purpose; }
public async Task CreateCourse(CourseView course) { Course coursesql = _mapper.Map <Course>(course); await _icourseSQL.Add(coursesql); await _icourseElastic.Add(coursesql); }
public ActionResult DeleteConfirmed(int id) { CourseView courseView = db.CourseViews.Find(id); db.CourseViews.Remove(courseView); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// method for flat mapping (without complex properties) /// </summary> /// <param name="courseView">courseView instance</param> /// <returns>Course instance (for BLL)</returns> public static Course MapFlat(this CourseView courseView) { var resultCourse = new Course(); resultCourse.Name = courseView.Name; resultCourse.CourseId = courseView.CourseEntityId; resultCourse.Start = courseView.Start; resultCourse.End = courseView.End; return resultCourse; }
public void HitTestRegular() { SymbolDB symbolDB = new SymbolDB(Util.GetFileInAppDirectory("symbols.xml")); UndoMgr undomgr = new UndoMgr(5); EventDB eventDB = new EventDB(undomgr); eventDB.Load(TestUtil.GetTestFile("descriptions\\sampleevent1.coursescribe")); eventDB.Validate(); CourseView courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(CourseId(4))); DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB, DescriptionFormatter.Purpose.ForPrinting); DescriptionLine[] description = descFormatter.CreateDescription(false); DescriptionRenderer descriptionRenderer = new DescriptionRenderer(symbolDB); descriptionRenderer.Description = description; descriptionRenderer.CellSize = 40; descriptionRenderer.Margin = 5; descriptionRenderer.DescriptionKind = DescriptionKind.Symbols; CheckHitTest(descriptionRenderer, new Point(201, 36), HitTestKind.Title, 0, 0, 0, new RectangleF(5, 5, 320, 40)); CheckHitTest(descriptionRenderer, new Point(79, 50), HitTestKind.Header, 1, 1, 0, new RectangleF(5, 45, 120, 40)); CheckHitTest(descriptionRenderer, new Point(145, 80), HitTestKind.Header, 1, 1, 1, new RectangleF(125, 45, 120, 40)); CheckHitTest(descriptionRenderer, new Point(289, 60), HitTestKind.Header, 1, 1, 2, new RectangleF(245, 45, 80, 40)); CheckHitTest(descriptionRenderer, new Point(175, 216), HitTestKind.NormalBox, 5, 5, 4, new RectangleF(165, 205, 40, 40)); CheckHitTest(descriptionRenderer, new Point(285, 365), HitTestKind.NormalBox, 9, 9, 7, new RectangleF(285, 365, 40, 40)); CheckHitTest(descriptionRenderer, new Point(81, 193), HitTestKind.Directive, 4, 4, 0, new RectangleF(5, 165, 320, 40)); CheckHitTest(descriptionRenderer, new Point(328, 147), HitTestKind.None, -1, -1, -1, new RectangleF(0, 0, 0, 0)); CheckHitTest(descriptionRenderer, new Point(255, 427), HitTestKind.OtherTextLine, 10, 10, 0, new RectangleF(5, 405, 320, 40)); descriptionRenderer.DescriptionKind = DescriptionKind.Text; CheckHitTest(descriptionRenderer, new Point(201, 36), HitTestKind.Title, 0, 0, 0, new RectangleF(5, 5, 320, 40)); CheckHitTest(descriptionRenderer, new Point(79, 50), HitTestKind.Header, 1, 1, 0, new RectangleF(5, 45, 120, 40)); CheckHitTest(descriptionRenderer, new Point(145, 80), HitTestKind.Header, 1, 1, 1, new RectangleF(125, 45, 120, 40)); CheckHitTest(descriptionRenderer, new Point(289, 60), HitTestKind.Header, 1, 1, 2, new RectangleF(245, 45, 80, 40)); CheckHitTest(descriptionRenderer, new Point(175, 216), HitTestKind.NormalText, 5, 5, -1, new RectangleF(85, 205, 240, 40)); CheckHitTest(descriptionRenderer, new Point(285, 365), HitTestKind.NormalText, 9, 9, -1, new RectangleF(85, 365, 240, 40)); CheckHitTest(descriptionRenderer, new Point(59, 302), HitTestKind.NormalBox, 7, 7, 1, new RectangleF(45, 285, 40, 40)); CheckHitTest(descriptionRenderer, new Point(81, 193), HitTestKind.DirectiveText, 4, 4, -1, new RectangleF(5, 165, 320, 40)); CheckHitTest(descriptionRenderer, new Point(328, 147), HitTestKind.None, -1, -1, -1, new RectangleF(0, 0, 0, 0)); CheckHitTest(descriptionRenderer, new Point(255, 427), HitTestKind.OtherTextLine, 10, 10, 0, new RectangleF(5, 405, 320, 40)); descriptionRenderer.DescriptionKind = DescriptionKind.SymbolsAndText; CheckHitTest(descriptionRenderer, new Point(201, 36), HitTestKind.Title, 0, 0, 0, new RectangleF(5, 5, 520, 40)); CheckHitTest(descriptionRenderer, new Point(79, 50), HitTestKind.Header, 1, 1, 0, new RectangleF(5, 45, 120, 40)); CheckHitTest(descriptionRenderer, new Point(145, 80), HitTestKind.Header, 1, 1, 1, new RectangleF(125, 45, 120, 40)); CheckHitTest(descriptionRenderer, new Point(289, 60), HitTestKind.Header, 1, 1, 2, new RectangleF(245, 45, 80, 40)); CheckHitTest(descriptionRenderer, new Point(175, 216), HitTestKind.NormalBox, 5, 5, 4, new RectangleF(165, 205, 40, 40)); CheckHitTest(descriptionRenderer, new Point(285, 365), HitTestKind.NormalBox, 9, 9, 7, new RectangleF(285, 365, 40, 40)); CheckHitTest(descriptionRenderer, new Point(81, 193), HitTestKind.Directive, 4, 4, 0, new RectangleF(5, 165, 320, 40)); CheckHitTest(descriptionRenderer, new Point(431, 56), HitTestKind.None, 1, 1, -1, new RectangleF(325, 45, 200, 40)); CheckHitTest(descriptionRenderer, new Point(333, 131), HitTestKind.NormalText, 3, 3, -1, new RectangleF(325, 125, 200, 40)); CheckHitTest(descriptionRenderer, new Point(491, 252), HitTestKind.DirectiveText, 6, 6, -1, new RectangleF(325, 245, 200, 40)); CheckHitTest(descriptionRenderer, new Point(527, 433), HitTestKind.None, -1, -1, -1, new RectangleF(0, 0, 0, 0)); CheckHitTest(descriptionRenderer, new Point(255, 427), HitTestKind.OtherTextLine, 10, 10, 0, new RectangleF(5, 405, 520, 40)); }
public async Task <CourseView> EditCourse(Guid id, CourseView course) { course.CourseID = id; Course courseDomain = _mapper.Map <Course>(course); await _icourseSQL.Update(id, _mapper.Map <Course>(courseDomain)); await _icourseElastic.Update(id, courseDomain); return(course); }
public ActionResult _CourseDetails(int id) { var queryCourse = _unitOfWork.Courses.GetByID(id); CourseView course = new CourseView(); var courseMap = AutoMapper.Mapper.Map(queryCourse, course); return(View(courseMap)); }
public void SetCurCourseView(int _cvIndex) { if (_cvIndex > curCourse.courseViews.Count - 1) { Debug.LogError("Index out of bounds: couldn't set current course view"); return; } curCourseView = curCourse.courseViews[_cvIndex]; }
/// <summary> /// method for flat mapping (without complex properties) /// </summary> /// <param name="course">course instance</param> /// <returns>CourseView instance (for Presentation)</returns> public static CourseView MapFlat(this Course course) { var resultCourse = new CourseView(); resultCourse.Name = course.Name; resultCourse.CourseEntityId = course.CourseId; resultCourse.Start = course.Start; resultCourse.End = course.End; resultCourse.Length = course.Length; return resultCourse; }
// Loop through the courseView List and return the course that matches, otherwise return -1 public int GetCourseViewIndex( CourseView view) { return curCourse.courseViews.IndexOf (view); }
public void SetCurCourseView(string _cvID) { int _cvIndex = curCourse.GetCourseViewIndexByID(_cvID); if (_cvIndex == -1) { Debug.LogError("Course View not found."); return; } curCourseView = curCourse.courseViews[_cvIndex]; }
internal void DumpCourseView(CourseView courseView, TextWriter writer) { writer.Write("Name='{0}', Kind='{1}', CourseId={2}", courseView.CourseName, courseView.Kind, courseView.BaseCourseId); if (! courseView.CourseDesignator.AllParts) writer.Write(", Part={0}", courseView.CourseDesignator.Part); writer.WriteLine(); writer.WriteLine("Total Length={0:G5} Part Length={1:G5} Total Climb={2} ScoreColumn={3} Total Score={4} Total Controls={5}", courseView.MaxTotalLength, courseView.PartLength, courseView.TotalClimb, courseView.ScoreColumn, courseView.TotalScore, courseView.TotalNormalControls); for (int i = 0; i < courseView.ControlViews.Count; ++i) { CourseView.ControlView controlView = courseView.ControlViews[i]; writer.Write("{0,2}: [{1,2}] Ids:{2,3}", i, controlView.ordinal, controlView.controlId, controlView.courseControlIds[0]); for (int j = 0; j < controlView.courseControlIds.Length; ++j) writer.Write(",{0,3}", controlView.courseControlIds[j]); if (controlView.hiddenControl) writer.Write(" hidden"); writer.WriteLine(); if (controlView.legTo != null) { writer.Write(" Legs: "); for (int j = 0; j < controlView.legTo.Length; ++j) writer.Write("(Next:{0},Id:{1},length:{2:G5}) ", controlView.legTo[j], controlView.legId[j], controlView.legLength[j]); writer.WriteLine(); } } for (int i = 0; i < courseView.SpecialIds.Count; ++i) { writer.WriteLine("Special {0} ({1})", courseView.SpecialIds[i], courseView.EventDB.GetSpecial(courseView.SpecialIds[i]).kind); } for (int i = 0; i < courseView.DescriptionViews.Count; ++i) { writer.WriteLine("Description {0} ({1})", courseView.DescriptionViews[i].SpecialId, courseView.DescriptionViews[i].CourseDesignator); } for (int i = 0; i < courseView.ExtraCourseControls.Count; ++i) { writer.WriteLine("Extra course control {0}", courseView.ExtraCourseControls[i].id); } }
// Render a description to a bitmap for testing purposes. Hardcoded 70 pixel box size. internal static Bitmap RenderToBitmap(EventDB eventDB, CourseView courseView, PunchcardFormat format) { PunchesRenderer punchesRenderer = new PunchesRenderer(eventDB); punchesRenderer.CourseView = courseView; punchesRenderer.PunchcardFormat = format; punchesRenderer.CellSize = 70; punchesRenderer.Margin = 4; SizeF size = punchesRenderer.Measure(); Bitmap bm = new Bitmap((int) size.Width, (int) size.Height); Graphics g = Graphics.FromImage(bm); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; g.Clear(Color.White); punchesRenderer.Draw(g, 0, 0, 0, punchesRenderer.Boxes.Height); g.Dispose(); return bm; }
/// <summary> /// デザイナー サポートに必要なメソッドです。このメソッドの内容を /// コード エディターで変更しないでください。 /// </summary> private void InitializeComponent() { this.mainMenu = new System.Windows.Forms.MenuStrip(); this.FileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); this.OpenVirtualLineMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveVirtualLineMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ExportVirtualLine = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.exitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CursorPosStatLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.statusBar = new System.Windows.Forms.StatusStrip(); this.playTimeStatLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.PlayStatLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.mainPanel = new System.Windows.Forms.Panel(); this.mainSplitContainer = new System.Windows.Forms.SplitContainer(); this.infoSplitContainer = new System.Windows.Forms.SplitContainer(); this.infoList = new System.Windows.Forms.ListView(); this.logLabel = new System.Windows.Forms.Label(); this.ControlPointValPanel = new System.Windows.Forms.Panel(); this.controlPointProperty = new System.Windows.Forms.PropertyGrid(); this.controlPointLabel = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.guidanceGroup = new System.Windows.Forms.GroupBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.OperationPanel = new System.Windows.Forms.Panel(); this.seekPanel = new System.Windows.Forms.Panel(); this.seekBar = new System.Windows.Forms.TrackBar(); this.buttonsPanel = new System.Windows.Forms.Panel(); this.hrLineLabel = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox4 = new System.Windows.Forms.PictureBox(); this.courseView = new GpsVisualizer.CourseView(); this.mainMenu.SuspendLayout(); this.statusBar.SuspendLayout(); this.mainPanel.SuspendLayout(); this.mainSplitContainer.Panel1.SuspendLayout(); this.mainSplitContainer.Panel2.SuspendLayout(); this.mainSplitContainer.SuspendLayout(); this.infoSplitContainer.Panel1.SuspendLayout(); this.infoSplitContainer.Panel2.SuspendLayout(); this.infoSplitContainer.SuspendLayout(); this.ControlPointValPanel.SuspendLayout(); this.panel1.SuspendLayout(); this.guidanceGroup.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.OperationPanel.SuspendLayout(); this.seekPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.seekBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); this.SuspendLayout(); // // mainMenu // this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FileMenuItem}); this.mainMenu.Location = new System.Drawing.Point(0, 0); this.mainMenu.Name = "mainMenu"; this.mainMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; this.mainMenu.Size = new System.Drawing.Size(839, 24); this.mainMenu.TabIndex = 7; this.mainMenu.Text = "menuStrip1"; // // FileMenuItem // this.FileMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.OpenMenuItem, this.saveMenuItem, this.toolStripMenuItem2, this.OpenVirtualLineMenuItem, this.SaveVirtualLineMenuItem, this.ExportVirtualLine, this.toolStripMenuItem1, this.exitMenuItem}); this.FileMenuItem.Name = "FileMenuItem"; this.FileMenuItem.Size = new System.Drawing.Size(66, 20); this.FileMenuItem.Text = "ファイル(&F)"; // // OpenMenuItem // this.OpenMenuItem.Name = "OpenMenuItem"; this.OpenMenuItem.Size = new System.Drawing.Size(229, 22); this.OpenMenuItem.Text = "走行ログを開く(&O)"; this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click); // // saveMenuItem // this.saveMenuItem.Name = "saveMenuItem"; this.saveMenuItem.Size = new System.Drawing.Size(229, 22); this.saveMenuItem.Text = "走行ログを可視化して保存(&V)"; this.saveMenuItem.Click += new System.EventHandler(this.saveMenuItem_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new System.Drawing.Size(226, 6); // // OpenVirtualLineMenuItem // this.OpenVirtualLineMenuItem.Name = "OpenVirtualLineMenuItem"; this.OpenVirtualLineMenuItem.Size = new System.Drawing.Size(229, 22); this.OpenVirtualLineMenuItem.Text = "仮想ラインを開く(&I)"; this.OpenVirtualLineMenuItem.Click += new System.EventHandler(this.OpenVirtualLineMenuItem_Click); // // SaveVirtualLineMenuItem // this.SaveVirtualLineMenuItem.Name = "SaveVirtualLineMenuItem"; this.SaveVirtualLineMenuItem.Size = new System.Drawing.Size(229, 22); this.SaveVirtualLineMenuItem.Text = "仮想ラインを保存(&S)"; this.SaveVirtualLineMenuItem.Click += new System.EventHandler(this.SaveVirtualLineMenuItem_Click); // // ExportVirtualLine // this.ExportVirtualLine.Name = "ExportVirtualLine"; this.ExportVirtualLine.Size = new System.Drawing.Size(229, 22); this.ExportVirtualLine.Text = "仮想ラインをnxtにエクスポート(&E)..."; this.ExportVirtualLine.Click += new System.EventHandler(this.ExportVirtualLine_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(226, 6); // // exitMenuItem // this.exitMenuItem.Name = "exitMenuItem"; this.exitMenuItem.Size = new System.Drawing.Size(229, 22); this.exitMenuItem.Text = "終了(&E)"; this.exitMenuItem.Click += new System.EventHandler(this.exitMenuItem_Click); // // CursorPosStatLabel // this.CursorPosStatLabel.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); this.CursorPosStatLabel.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; this.CursorPosStatLabel.Name = "CursorPosStatLabel"; this.CursorPosStatLabel.Size = new System.Drawing.Size(736, 17); this.CursorPosStatLabel.Spring = true; this.CursorPosStatLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // statusBar // this.statusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.CursorPosStatLabel, this.playTimeStatLabel, this.PlayStatLabel}); this.statusBar.Location = new System.Drawing.Point(0, 579); this.statusBar.Name = "statusBar"; this.statusBar.Size = new System.Drawing.Size(839, 22); this.statusBar.TabIndex = 13; // // playTimeStatLabel // this.playTimeStatLabel.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); this.playTimeStatLabel.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; this.playTimeStatLabel.Name = "playTimeStatLabel"; this.playTimeStatLabel.Size = new System.Drawing.Size(55, 17); this.playTimeStatLabel.Text = "hh:mm:ss"; // // PlayStatLabel // this.PlayStatLabel.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom))); this.PlayStatLabel.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter; this.PlayStatLabel.Name = "PlayStatLabel"; this.PlayStatLabel.Size = new System.Drawing.Size(33, 17); this.PlayStatLabel.Text = "停止"; // // mainPanel // this.mainPanel.Controls.Add(this.mainSplitContainer); this.mainPanel.Controls.Add(this.OperationPanel); this.mainPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.mainPanel.Location = new System.Drawing.Point(0, 24); this.mainPanel.Name = "mainPanel"; this.mainPanel.Size = new System.Drawing.Size(839, 555); this.mainPanel.TabIndex = 14; // // mainSplitContainer // this.mainSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.mainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.mainSplitContainer.Location = new System.Drawing.Point(0, 0); this.mainSplitContainer.Name = "mainSplitContainer"; // // mainSplitContainer.Panel1 // this.mainSplitContainer.Panel1.Controls.Add(this.courseView); // // mainSplitContainer.Panel2 // this.mainSplitContainer.Panel2.Controls.Add(this.infoSplitContainer); this.mainSplitContainer.Panel2MinSize = 128; this.mainSplitContainer.Size = new System.Drawing.Size(839, 519); this.mainSplitContainer.SplitterDistance = 627; this.mainSplitContainer.TabIndex = 11; // // infoSplitContainer // this.infoSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.infoSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.infoSplitContainer.Location = new System.Drawing.Point(0, 0); this.infoSplitContainer.Name = "infoSplitContainer"; this.infoSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; // // infoSplitContainer.Panel1 // this.infoSplitContainer.Panel1.Controls.Add(this.infoList); this.infoSplitContainer.Panel1.Controls.Add(this.logLabel); // // infoSplitContainer.Panel2 // this.infoSplitContainer.Panel2.Controls.Add(this.ControlPointValPanel); this.infoSplitContainer.Panel2.Controls.Add(this.controlPointLabel); this.infoSplitContainer.Panel2.Controls.Add(this.panel1); this.infoSplitContainer.Size = new System.Drawing.Size(208, 519); this.infoSplitContainer.SplitterDistance = 112; this.infoSplitContainer.TabIndex = 0; // // infoList // this.infoList.Dock = System.Windows.Forms.DockStyle.Fill; this.infoList.Location = new System.Drawing.Point(0, 23); this.infoList.Name = "infoList"; this.infoList.Size = new System.Drawing.Size(208, 89); this.infoList.TabIndex = 6; this.infoList.UseCompatibleStateImageBehavior = false; // // logLabel // this.logLabel.Dock = System.Windows.Forms.DockStyle.Top; this.logLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.logLabel.Location = new System.Drawing.Point(0, 0); this.logLabel.Name = "logLabel"; this.logLabel.Size = new System.Drawing.Size(208, 23); this.logLabel.TabIndex = 5; this.logLabel.Text = "ログ取得値(&L):"; this.logLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // ControlPointValPanel // this.ControlPointValPanel.AutoScroll = true; this.ControlPointValPanel.Controls.Add(this.controlPointProperty); this.ControlPointValPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.ControlPointValPanel.Location = new System.Drawing.Point(0, 23); this.ControlPointValPanel.Name = "ControlPointValPanel"; this.ControlPointValPanel.Size = new System.Drawing.Size(208, 326); this.ControlPointValPanel.TabIndex = 3; // // controlPointProperty // this.controlPointProperty.Dock = System.Windows.Forms.DockStyle.Fill; this.controlPointProperty.Location = new System.Drawing.Point(0, 0); this.controlPointProperty.Name = "controlPointProperty"; this.controlPointProperty.Size = new System.Drawing.Size(208, 326); this.controlPointProperty.TabIndex = 30; this.controlPointProperty.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.controlPointProperty_PropertyValueChanged); // // controlPointLabel // this.controlPointLabel.Dock = System.Windows.Forms.DockStyle.Top; this.controlPointLabel.Location = new System.Drawing.Point(0, 0); this.controlPointLabel.Name = "controlPointLabel"; this.controlPointLabel.Size = new System.Drawing.Size(208, 23); this.controlPointLabel.TabIndex = 2; this.controlPointLabel.Text = "制御点(&P):"; this.controlPointLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // panel1 // this.panel1.Controls.Add(this.guidanceGroup); this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Location = new System.Drawing.Point(0, 349); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(208, 54); this.panel1.TabIndex = 31; // // guidanceGroup // this.guidanceGroup.Controls.Add(this.label2); this.guidanceGroup.Controls.Add(this.label1); this.guidanceGroup.Controls.Add(this.pictureBox2); this.guidanceGroup.Controls.Add(this.pictureBox1); this.guidanceGroup.Dock = System.Windows.Forms.DockStyle.Bottom; this.guidanceGroup.Location = new System.Drawing.Point(0, 6); this.guidanceGroup.Name = "guidanceGroup"; this.guidanceGroup.Size = new System.Drawing.Size(208, 48); this.guidanceGroup.TabIndex = 29; this.guidanceGroup.TabStop = false; this.guidanceGroup.Text = "制御点の記号"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(121, 28); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(41, 12); this.label2.TabIndex = 12; this.label2.Text = "最後尾"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(34, 28); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(29, 12); this.label1.TabIndex = 11; this.label1.Text = "先頭"; // // pictureBox2 // this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox2.Image = global::GpsVisualizer.Properties.Resources.finishPoint; this.pictureBox2.Location = new System.Drawing.Point(93, 18); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(22, 22); this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox2.TabIndex = 10; this.pictureBox2.TabStop = false; // // pictureBox1 // this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox1.Image = global::GpsVisualizer.Properties.Resources.startPoint; this.pictureBox1.Location = new System.Drawing.Point(6, 18); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(22, 22); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox1.TabIndex = 9; this.pictureBox1.TabStop = false; // // OperationPanel // this.OperationPanel.Controls.Add(this.seekPanel); this.OperationPanel.Controls.Add(this.buttonsPanel); this.OperationPanel.Controls.Add(this.hrLineLabel); this.OperationPanel.Dock = System.Windows.Forms.DockStyle.Bottom; this.OperationPanel.Location = new System.Drawing.Point(0, 519); this.OperationPanel.Name = "OperationPanel"; this.OperationPanel.Size = new System.Drawing.Size(839, 36); this.OperationPanel.TabIndex = 10; // // seekPanel // this.seekPanel.Controls.Add(this.seekBar); this.seekPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.seekPanel.Enabled = false; this.seekPanel.Location = new System.Drawing.Point(0, 2); this.seekPanel.Name = "seekPanel"; this.seekPanel.Padding = new System.Windows.Forms.Padding(2); this.seekPanel.Size = new System.Drawing.Size(826, 34); this.seekPanel.TabIndex = 7; // // seekBar // this.seekBar.AutoSize = false; this.seekBar.Dock = System.Windows.Forms.DockStyle.Fill; this.seekBar.Location = new System.Drawing.Point(2, 2); this.seekBar.Maximum = 0; this.seekBar.Name = "seekBar"; this.seekBar.Size = new System.Drawing.Size(822, 30); this.seekBar.TabIndex = 3; this.seekBar.TickStyle = System.Windows.Forms.TickStyle.None; this.seekBar.Scroll += new System.EventHandler(this.seekBar_Scroll); // // buttonsPanel // this.buttonsPanel.Dock = System.Windows.Forms.DockStyle.Right; this.buttonsPanel.Location = new System.Drawing.Point(826, 2); this.buttonsPanel.Name = "buttonsPanel"; this.buttonsPanel.Size = new System.Drawing.Size(13, 34); this.buttonsPanel.TabIndex = 6; // // hrLineLabel // this.hrLineLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.hrLineLabel.Dock = System.Windows.Forms.DockStyle.Top; this.hrLineLabel.Location = new System.Drawing.Point(0, 0); this.hrLineLabel.Name = "hrLineLabel"; this.hrLineLabel.Size = new System.Drawing.Size(839, 2); this.hrLineLabel.TabIndex = 0; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(121, 28); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(41, 12); this.label3.TabIndex = 12; this.label3.Text = "最後尾"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(34, 28); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(29, 12); this.label4.TabIndex = 11; this.label4.Text = "先頭"; // // pictureBox3 // this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox3.Image = global::GpsVisualizer.Properties.Resources.finishPoint; this.pictureBox3.Location = new System.Drawing.Point(93, 18); this.pictureBox3.Name = "pictureBox3"; this.pictureBox3.Size = new System.Drawing.Size(22, 22); this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox3.TabIndex = 10; this.pictureBox3.TabStop = false; // // pictureBox4 // this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox4.Image = global::GpsVisualizer.Properties.Resources.startPoint; this.pictureBox4.Location = new System.Drawing.Point(6, 18); this.pictureBox4.Name = "pictureBox4"; this.pictureBox4.Size = new System.Drawing.Size(22, 22); this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox4.TabIndex = 9; this.pictureBox4.TabStop = false; // // courseView // this.courseView.AutoScroll = true; this.courseView.Dock = System.Windows.Forms.DockStyle.Fill; this.courseView.Location = new System.Drawing.Point(0, 0); this.courseView.Name = "courseView"; this.courseView.Size = new System.Drawing.Size(627, 519); this.courseView.TabIndex = 0; // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(839, 601); this.Controls.Add(this.mainPanel); this.Controls.Add(this.mainMenu); this.Controls.Add(this.statusBar); this.MainMenuStrip = this.mainMenu; this.Name = "MainWindow"; this.Text = "GPS Visualizer"; this.mainMenu.ResumeLayout(false); this.mainMenu.PerformLayout(); this.statusBar.ResumeLayout(false); this.statusBar.PerformLayout(); this.mainPanel.ResumeLayout(false); this.mainSplitContainer.Panel1.ResumeLayout(false); this.mainSplitContainer.Panel2.ResumeLayout(false); this.mainSplitContainer.ResumeLayout(false); this.infoSplitContainer.Panel1.ResumeLayout(false); this.infoSplitContainer.Panel2.ResumeLayout(false); this.infoSplitContainer.ResumeLayout(false); this.ControlPointValPanel.ResumeLayout(false); this.panel1.ResumeLayout(false); this.guidanceGroup.ResumeLayout(false); this.guidanceGroup.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.OperationPanel.ResumeLayout(false); this.seekPanel.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.seekBar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
// Loop through the courseView List and return the course that matches, otherwise return -1 public int GetCourseViewIndex ( CourseView view) { int _cvIndex = curCourse.courseViews.IndexOf(view); if (_cvIndex == -1) { Debug.LogError("CourseView couldn't be found in courseViews list."); return -1; } else { return _cvIndex; } }
private DescriptionLine[] GetDescription() { CourseItem courseItem = (CourseItem)(listBoxCourses.SelectedItem); Id<Course> id; if (courseItem == null) id = Id<Course>.None; else id = courseItem.id; courseView = CourseView.CreateViewingCourseView(eventDB, new CourseDesignator(id)); DescriptionFormatter descFormatter = new DescriptionFormatter(courseView, symbolDB); return descFormatter.CreateDescription(false); }
private void LoadCourseViewDefaultCode(CourseView cv) { string _code = cv.defaultCode; // load default code codeField.text = _code; // set caret position int _caretIndex = _code.IndexOf("CARET"); if (_caretIndex != -1) { codeField.caretPosition = _caretIndex; codeField.text = codeField.text.Replace("CARET", ""); } codeField.m_Select(); }