/// <summary> /// 编辑点按下事件 /// </summary> /// <param name="element"></param> /// <param name="e"></param> private void editPoint_MarkerMouseDownEvent(IElement element, IMapControlEvents2_OnMouseDownEvent e) { if (element == null) { return; } currentPoint = new PointClass(); currentPoint.PutCoords(e.mapX, e.mapY); currentMarker = element as Model.EditMarker; }
/// <summary> /// 释放该类 /// </summary> public void Dispose() { ReleaseCommond(); CommondExecutedEvent = null; currentPoint = null; markerList = null; editPoint = null; pointList = null; layer = null; mapControl = null; lineElement = null; }
/// <summary> /// 初始化 /// </summary> private void InitMarker() { IPointCollection linePoint = lineElement.Geometry as IPointCollection; int cout = linePoint.PointCount; bool markerBeing = false; for (int i = 0; i < cout; i++) { IPoint p = linePoint.get_Point(i); editPoint = new MapFrame.ArcMap.Model.EditMarker(mapControl, layer); markerList.Add(editPoint); if (!markerBeing) { editPoint.MarkerMouseDownEvent += editPoint_MarkerMouseDownEvent; editPoint.MarkerMouseUpEvent += editPoint_MarkerMouseUpEvent; editPoint.MarkerMouseMoveEvent += editPoint_MarkerMouseMoveEvent; } editPoint.InitMarker(i.ToString(), p); (layer as CompositeGraphicsLayerClass).AddElement(editPoint, 0); markerBeing = true; } mapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); }