项目:基于GIS操作语义的制图系统
需求:在草图工具的OnSketchFinshed事件中封装操作消息体
参考:https://www.cnblogs.com/yhlx125/archive/2012/02/27/2369572.html
1 代码
private IEngineEditor m_EngineEditor = new EngineEditorClass(); private IEngineEditEvents_Event m_EngineEditEvent; private void axMapControl1_OnMouseUp(object sender, IMapControlEvents2_OnMouseUpEvent e) { if (m_EngineEditor.EditState == esriEngineEditState.esriEngineStateEditing) { m_EngineEditEvent = m_EngineEditor as IEngineEditEvents_Event; //订阅事件 m_EngineEditEvent.OnSketchFinished += new IEngineEditEvents_OnSketchFinishedEventHandler(m_EngineEditEvent_OnSketchFinished); } } private void m_EngineEditEvent_OnSketchFinished() { MessageBox.Show("完成草图"); }