Exemplo n.º 1
0
        public bool StartSelecting(Layer.ResTBPostGISType type)
        {
            CurrentSelectionLayers = new List <ILayer>();

            UnselectAllLayer();

            foreach (ILayer layer in MapControlTools.Layers)
            {
                if (layer.GetType() == typeof(ResTBDamagePotentialLayer))
                {
                    if (((ResTBPostGISLayer)layer).ResTBPostGISType == type)
                    {
                        ResTBDamagePotentialLayer resTBDamagePotentialLayer = (ResTBDamagePotentialLayer)layer;

                        CurrentSelectionLayers.Add(resTBDamagePotentialLayer);

                        Shapefile sf = AxMap.get_Shapefile(resTBDamagePotentialLayer.PointHandle);
                        sf.Identifiable = true;
                        sf.Selectable   = true;
                        sf = AxMap.get_Shapefile(resTBDamagePotentialLayer.LineHandle);
                        sf.Identifiable = true;
                        sf.Selectable   = true;
                        sf = AxMap.get_Shapefile(resTBDamagePotentialLayer.PolygonHandle);
                        sf.Identifiable = true;
                        sf.Selectable   = true;
                    }
                }
                else if (layer.GetType().BaseType == typeof(ResTBPostGISLayer))
                {
                    if (((ResTBPostGISLayer)layer).ResTBPostGISType == type)
                    {
                        AddLayerToSelectionList(layer);
                    }
                }
            }

            IsEditing           = true;
            AxMap.SendMouseDown = true;
            AxMap.SendMouseUp   = true;

            AxMap.ShapeIdentified -= AxMap_ShapeIdentified;
            AxMap.ShapeIdentified += AxMap_ShapeIdentified;

            Events.MapControl_SelectingStateChange selectingStateChange = new Events.MapControl_SelectingStateChange()
            {
                SelectingState = Events.SelectingState.StartSelecting, SelectingLayers = CurrentSelectionLayers
            };
            On_SelectingStateChange(selectingStateChange);

            AxMap.Identifier.IdentifierMode = tkIdentifierMode.imAllLayers;
            AxMap.Identifier.OutlineColor   = utils.ColorByName(tkMapColor.Yellow);
            AxMap.CursorMode = tkCursorMode.cmIdentify;

            return(true);
        }
 public bool StartSelecting(Layer.ResTBPostGISType type)
 {
     return(SelectObjectTool.StartSelecting(type));
 }