コード例 #1
0
ファイル: RouteRecorderForm.cs プロジェクト: uvbs/babbot
        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();
        }
コード例 #2
0
ファイル: RoutesForm.cs プロジェクト: uvbs/babbot
        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);
            }
        }
コード例 #3
0
ファイル: TravelState.cs プロジェクト: uvbs/babbot
        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);
        }