标签:
监听MapControl中对于图层添加和删除的事件
IActiveViewEvents_Event m_MapActiveViewEvents = m_mapControl.Map as IActiveViewEvents_Event;
//添加图层事件
m_MapActiveViewEvents.ItemAdded += new IActiveViewEvents_ItemAddedEventHandler(m_MapActiveViewEvents_ItemAdded);
//删除图层事件
m_MapActiveViewEvents.ItemDeleted += new IActiveViewEvents_ItemDeletedEventHandler(m_MapActiveViewEvents_ItemDeleted);
//事件处理
void m_MapActiveViewEvents_ItemDeleted(object item)
{
ILayer pLayer = item as ILayer;
//...
}
void m_MapActiveViewEvents_ItemAdded(object item)
{
ILayer pLayer = item as ILayer;
//...
}
标签:
原文地址:http://www.cnblogs.com/zhangcjing/p/5902473.html