arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)

发布时间:2022-06-29 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

IGraphicsContainerevents Interface

如何监听 element事件?
如,当我们在Mapcontrol上添加、删除、更新了一个Element后,如何捕捉到这个事件?
   1,首先定义全局变量: IGraphicsContainerEvents_Event pGraphicsContainerEvent;
   2,在Form1_Load中给该变量赋值: pGraphicsContainerEvent = this.aXMapControl1.ActiveView.FocusMap.BasicGraphicsLayer as IGraphicsContainerEvents_Event;
   3,添加事件处理
pGraphicsContainerEvent.ElementAdded += new IGraphicsContainerEvents_ElementAddedEventHandler(ElementAddedMethod);
 
           pGraphicsContainerEvent.ElementDeleted +=new IGraphicsContainerEvents_ElementDeletedEventHandler(ElementDeletedMethod);
 
            pGraphicsContainerEvent.ElementUpdated += new IGraphicsContainerEvents_ElementUpdatedEventHandler( ElementUpdatedMethod);
4,定义事件:
  PRivate void ElementAddedMethod(IElement i)
        {
            System.Windows.Forms.MessageBox.Show("Element Added");
            axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
        }
        private void ElementDeletedMethod(IElement i)
        {
            System.Windows.Forms.MessageBox.Show("Element Deleted");
            axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
        }
        private void ElementUpdatedMethod(IElement i)
        {
            System.Windows.Forms.MessageBox.Show("Element Updated");
            axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
        }
http://blog.sina.COM.cn/s/bLOG_90b91bF10100yks1.htML
 
 
 
 
@H_406_141@
 AllProPErtiESMethodsDescription

arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)

AllElementsDeleted Occurs when all the elements are deleted.

arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)

ElementAdded Occurs when the element is added.

arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)

ElementDeleted Occurs when the element is deleted.

arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)

ElementsAdded Occurs when the elements are added.

arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)

ElementUpdated Occurs when the element is updated.

脚本宝典总结

以上是脚本宝典为你收集整理的arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)全部内容,希望文章能够帮你解决arcgis engine 监听element的添加、更新和删除事件(使用IGraphicsContainerEvents)所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。