Esempio n. 1
0
        private void AddBranchLayerAndTool()
        {
            var branches = new EventedList <IBranch>();

            branchLayer.DataSource = new FeatureCollection(branches, typeof(Branch));

            //reachLayer.VectorLayer.Name = "reaches";
            branchLayer.Visible = true;
            branchLayer.Style   = new VectorStyle
            {
                Fill   = new SolidBrush(Color.Tomato),
                Symbol = null,
                Line   = new Pen(Color.Turquoise, 3)
            };
            mapControl.Map.Layers.Insert(0, branchLayer);

            var newLineTool = new NewLineTool(branchLayer)
            {
                AutoCurve = true, MinDistance = 0
            };

            mapControl.Tools.Add(newLineTool);
            //newLineTool.EditorLayer = reachLayer;

            //BranchNodeTopology t = new BranchNodeTopology();

            //t.Branches = reachLayer.DataSource;
            //t.Nodes = nodeLayer.DataSource;
            // MoveTool.Endoperation += t.endMove();
        }
Esempio n. 2
0
        // TODO: this test is strange, there should be tests for tools, checking how many Tools exist in map control or state of default tools should be in MapControlTest class and not here
        public void CustomGeometryEditorTools()
        {
            InitializeControls();
            AddBranchLayerAndTool();

            IMapTool mapTool = mapControl.GetToolByName(branchLayer.Name);

            Assert.IsNotNull(mapTool);
            NewLineTool newLineTool = mapTool as NewLineTool;

            Assert.IsNotNull(newLineTool);
        }
Esempio n. 3
0
        private MapTool AddBranchLayerAndTool()
        {
            branchLayer.DataSource = new FeatureCollection((IList)network.Branches, typeof(Branch));
            branchLayer.Visible    = true;
            branchLayer.Style      = new VectorStyle
            {
                Fill   = new SolidBrush(Color.Tomato),
                Symbol = null,
                Line   = new Pen(Color.Turquoise, 3)
            };
            mapControl.Map.Layers.Insert(0, branchLayer);

            var newLineTool = new NewLineTool(l => l.Equals(branchLayer), "new branch")
            {
                AutoCurve = true, MinDistance = 0
            };

            mapControl.Tools.Add(newLineTool);
            return(newLineTool);
        }