zoukankan      html  css  js  c++  java
  • IEngineEditor与IWorkspaceEdit,以及相关的事件监听

    转自原文 IEngineEditor与IWorkspaceEdit,以及相关的事件监听

    IEngineEditor适用于直接在图层上的编辑,例如使用“要素编辑”工具菜单上的“开始编辑”等工具进行编辑,相应的事件使用IWorkspaceEdit监听,例如以下的代码:

    private IEngineEditor m_EngineEditor = new EngineEditorClass();  
    private IEngineEditEvents_Event m_EngineEditEvents ;  
    private void MainForm_Load(object sender,EventArgs e)  
    {  
         //get the MapControl  
         m_mapControl = (IMapControl3)axMapControl1.Object;  
         //disable the Save menu (since there is no document yet)  
         menuSaveDoc.Enabled = false;  
         m_EngineEditEvents = (IEngineEditEvents_Event)m_EngineEditor;  
         m_EngineEditEvents.OnStartEditing += new IEngineEditEvents_OnStartEditingEventHandler(m_EngineEditEvents_OnStartEditing);  
    }  
    void m_EngineEditEvents_OnStartEditing()  
    {  
         MessageBox.Show("Start Editing");       
    }   

    IWorkspaceEdit适用于直接对workspace进行的编辑,相应的事件使用IWorkspaceEditEvents_Event监听,例如以下的代码:

    private IWorkspaceEdit wsEdit;  
    private IWorkspaceEditEvents_Event wsEditEvents;  
    private void MainForm_Load(object sender,EventArgs e)  
    {  
          //get the MapControl  
          m_mapControl = (IMapControl3)axMapControl1.Object;  
          //disable the Save menu (since there is no document yet)  
           menuSaveDoc.Enabled = false;  
          wsEdit = MyTool.GetWorkspaceEdit(map1.Map);  
          wsEditEvents = (IWorkspaceEditEvents_Event)wsEdit;  
          wsEditEvents.OnStopEditing += new IWorkspaceEditEvents_OnStopEditingEventHandler(wsEditEvents_OnStopEditing);  
    }  
    void wsEditEvents_OnStopEditing(bool saveEdits)  
    {  
          MessageBox.Show("StopEditing");  
    }  
  • 相关阅读:
    跨浏览器的事件处理程序
    jQuery提交Form
    js 多种变量定义(对象直接量,数组直接量和函数直接量)
    Asp.net Eval 截取字符串
    sql执行顺序
    IDEA File Templates模板
    Vim快捷键大全(转)
    Rider+Unity+XLua环境配置
    一定要进行代码复查
    如何在ubuntu上面安装luasocket
  • 原文地址:https://www.cnblogs.com/arxive/p/6262456.html
Copyright © 2011-2022 走看看