public void Open(Route route) { _route = route; ctrlRouteDetails.PopulateControls(route); Waypoints wp = null; try { // Fill waypoints wp = RouteListManager.LoadWaypoints(route.WaypointFileName); } catch (Exception e) { ShowErrorMessage(e); Dispose(); return; } // Fill data table foreach (Vector3D v in wp.List) { dgWaypoints.Rows.Add(v.X, v.Y, v.Z); } // Select last int last = dgWaypoints.Rows.Count - 1; dgWaypoints.FirstDisplayedScrollingRowIndex = last; // Assign event on shown Shown += SelectLastRecord; ShowDialog(); }
private void exportRouteToolStripMenuItem_Click(object sender, EventArgs e) { Route r = GetSelectedRoute(); // Load waypoints Waypoints wp = RouteListManager.LoadWaypoints(r.WaypointFileName); if (RouteListManager.ExportRoute(r, wp)) { ShowSuccessMsg(r, "exported", true); } }
private Waypoints GetWaypoints(Route r) { Waypoints wp = RouteListManager.LoadWaypoints(r.WaypointFileName); if (wp != null) { if (r.NeedReverse) { wp.List.Reverse(); } UsedRoutes.Add(r); } return(wp); }