예제 #1
0
        public void InitializeWaypoints(NavigationReader reader)
        {
            this.SuspendLayout();
            _nodeControl = new NodeControl();
            _nodeControl.Dock = DockStyle.Fill;

            _actionControl = new ActionControl();
            _actionControl.Dock = DockStyle.Fill;

            _routeControl = new RouteControl();
            _routeControl.Dock = DockStyle.Fill;

            TabPage nodes = new TabPage("Nodes");
            nodes.Controls.Add(_nodeControl);

            TabPage actions = new TabPage("Actions");
            actions.Controls.Add(_actionControl);

            TabPage routes = new TabPage("Routes");
            routes.Controls.Add(_routeControl);

            tcMain.TabPages.Clear();
            tcMain.TabPages.Add(nodes);
            tcMain.TabPages.Add(actions);
            tcMain.TabPages.Add(routes);

            _nodeControl.InitializeNodes(reader.Nodes, reader.HasBadConnects);
            _actionControl.InitializeActions(reader.Actions);
            _routeControl.InitializeRoutes(reader.Routes, _actionControl.Actions);

            this.ResumeLayout(false);

            try
            {
                if (System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count > 0)
                {
                    _nodePrinter = new NodePrinter(printDocument, _nodeControl.Nodes, Path.GetFileName(reader.FileName));
                    _actionPrinter = new ActionPrinter(printDocument, _actionControl.Actions, Path.GetFileName(reader.FileName));
                    _routePrinter = new RoutePrinter(printDocument, _routeControl.Routes, Path.GetFileName(reader.FileName));
                }
            }
            catch
            {
            }
        }