private void InitTools()
 {
     AddLayersTool     = new AddLayersTool(AxMap, this);
     EditingTool       = new EditingTool(AxMap, this);
     LayerHandlingTool = new LayerHandlingTool(AxMap, this);
     SelectObjectTool  = new SelectObjectTool(AxMap, this);
     ExportImportTool  = new ExportImportTool(AxMap, this);
     PrintTool         = new PrintTool(AxMap, this);
 }
 public BuildingProperties(int xs, int ys, MapTileCharacters baseTile, EditingTool tool, string name, bool anim)
 {
     this.SizeX      = xs;
     this.SizeY      = ys;
     this.BaseTile   = baseTile;
     this.Tool       = tool;
     this.Name       = name;
     this.IsAnimated = anim;
 }
Example #3
0
        /// <summary>
        /// Add tool.
        /// </summary>
        /// <param name="tool">Tool for adding.</param>
        /// <param name="canActivateToolHandler">Delegate to check can activated.</param>
        public void AddTool(IMapTool tool, CanActivateToolHandler canActivateToolHandler)
        {
            EditingTool editingTool = tool as EditingTool;

            if (editingTool != null)
            {
                _AddEditingTool(editingTool);
            }
            else
            {
                _AddTool(tool, canActivateToolHandler);
            }

            tool.OnComplete += new EventHandler(_OnCompleteTool);
        }
Example #4
0
        /// <summary>
        /// Add editing tool to tools list.
        /// </summary>
        /// <param name="tool">Editing tool.</param>
        private void _AddEditingTool(EditingTool tool)
        {
            Debug.Assert(_editingTool == null);

            _editedCollection  = new ObservableCollection <object>();
            _editedObjectLayer = new ObjectLayer(_editedCollection, typeof(object), false);
            _editedObjectLayer.ConstantOpacity = true;
            _mapctrl.AddLayer(_editedObjectLayer);

            _editMarkers      = new ObservableCollection <EditingMarker>();
            _editMarkersLayer = new ObjectLayer(_editMarkers, typeof(EditingMarker), false);
            _editMarkersLayer.ConstantOpacity = true;
            _mapctrl.AddLayer(_editMarkersLayer);

            _editingTool = (EditingTool)tool;
            _editingTool.Initialize(_mapctrl);

            _editingTool.SetLayer(_editMarkersLayer);
            _editingTool.CursorChanged += new EventHandler(_EditingToolCursorChanged);
        }
 public void Undo()
 {
     EditingTool.Undo();
 }
 public bool SaveEdits()
 {
     return(EditingTool.SaveEdits());
 }
 public bool DeleteAllShapes()
 {
     return(EditingTool.DeleteAllShapes());
 }
 public bool DeleteShape()
 {
     return(EditingTool.DeleteShape());
 }
 public bool EditShape(int shapeIndex = -1)
 {
     return(EditingTool.EditShape(shapeIndex));
 }
 public bool AddShape(bool saveAndStopWhenFinish = false)
 {
     return(EditingTool.AddShape(saveAndStopWhenFinish));
 }
 public bool StopEditingLayer(bool saveEdits = false)
 {
     return(EditingTool.StopEditingLayer(saveEdits));
 }
 public bool StartEditingLayer(string name, bool saveAndStopWhenFinish = false, FeatureType featureType = FeatureType.Any)
 {
     return(EditingTool.StartEditingLayer(name, saveAndStopWhenFinish, featureType));
 }
 public bool StartEditingLayer(DB.Models.Objectparameter objectparameter, bool saveAndStopWhenFinish = false)
 {
     return(EditingTool.StartEditingLayer(objectparameter, saveAndStopWhenFinish));
 }
 /// Editing Tools
 public bool StartEditingLayer(ResTBHazardMapLayer hazardMapLayer, bool saveAndStopWhenFinish = false)
 {
     return(EditingTool.StartEditingLayer(hazardMapLayer, saveAndStopWhenFinish));
 }