public void OnCreate(object Hook)
        {
            EditVertexClass.ClearResource();
            if (Hook == null)
            {
                return;
            }
            try
            {
                m_hookHelper      = new HookHelperClass();
                m_hookHelper.Hook = Hook;
                if (m_hookHelper.ActiveView == null)
                {
                    m_hookHelper = null;
                }
            }
            catch
            {
                m_hookHelper = null;
            }

            if (m_hookHelper == null)
            {
                bEnable = false;
            }
            else
            {
                bEnable = true;
            }
        }
Exemple #2
0
 public void OnClick()
 {
     m_Map              = m_hookHelper.FocusMap;
     m_activeView       = m_Map as IActiveView;
     m_EngineEditor     = MapManager.EngineEditor;
     m_EngineEditLayers = MapManager.EngineEditor as IEngineEditLayers;
     EditVertexClass.ClearResource();
 }
        public void OnClick()
        {
            try
            {
                m_Map          = m_hookHelper.FocusMap;
                m_activeView   = m_Map as IActiveView;
                m_EngineEditor = MapManager.EngineEditor;
                EditVertexClass.ClearResource();
                if (m_EngineEditor == null)
                {
                    return;
                }
                if (m_EngineEditor.EditState != esriEngineEditState.esriEngineStateEditing)
                {
                    return;
                }
                //此处应为IWorkspaceEdit,若为IWorkspaceEdit2无法强制转换
                IWorkspaceEdit pWSEdit    = m_EngineEditor.EditWorkspace as IWorkspaceEdit;
                IWorkspace     pWorkspace = m_EngineEditor.EditWorkspace;
                if (pWSEdit == null)
                {
                    return;
                }
                Boolean bHasUndo = true;

                if (pWorkspace.Type == esriWorkspaceType.esriRemoteDatabaseWorkspace)
                {
                    m_EngineEditor.EditSessionMode = esriEngineEditSessionMode.esriEngineEditSessionModeNonVersioned;
                }

                //m_EngineEditor.EditSessionMode = esriEngineEditSessionMode.esriEngineEditSessionModeVersioned;
                pWSEdit.HasUndos(ref bHasUndo);
                if (bHasUndo)
                {
                    pWSEdit.UndoEditOperation();
                }
                m_activeView.Refresh();
            }
            catch (Exception ex)
            {
                //SysLogHelper.WriteOperationLog("编辑恢复错误", ex.Source, "数据编辑");
            }
        }
        public void OnClick()
        {
            m_Map              = m_hookHelper.FocusMap;
            m_activeView       = m_Map as IActiveView;
            m_EngineEditor     = MapManager.EngineEditor;
            m_EngineEditLayers = MapManager.EngineEditor as IEngineEditLayers;

            EditVertexClass.m_activeView = m_activeView;
            EditVertexClass.m_Map        = m_Map;

            EditVertexClass.ClearResource();

            if (m_EngineEditor == null)
            {
                return;
            }
            if (m_EngineEditor.EditState != esriEngineEditState.esriEngineStateEditing)
            {
                return;
            }
            if (m_EngineEditLayers == null)
            {
                return;
            }

            IFeatureLayer pFeatLyr = m_EngineEditLayers.TargetLayer;

            if (pFeatLyr == null)
            {
                return;
            }
            IFeatureCursor pFeatCur = MapManager.GetSelectedFeatures(pFeatLyr);

            if (pFeatCur == null)
            {
                MessageBox.Show("请选择要删除节点的要素!", "提示",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            EditVertexClass.ShowAllVertex(pFeatLyr);

            ((IActiveViewEvents_Event)m_Map).AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(map_AfterDraw);
        }
        public void OnCreate(object Hook)
        {
            try
            {
                EditVertexClass.ClearResource();

                if (Hook == null)
                {
                    return;
                }
                try
                {
                    m_hookHelper      = new HookHelperClass();
                    m_hookHelper.Hook = Hook;
                    if (m_hookHelper.ActiveView == null)
                    {
                        m_hookHelper = null;
                    }
                }
                catch
                {
                    m_hookHelper = null;
                }

                if (m_hookHelper == null)
                {
                    bEnable = false;
                }
                else
                {
                    bEnable = true;
                }
            }
            catch (Exception ex)
            {
                //SysLogHelper.WriteOperationLog("恢复撤销编辑错误", ex.Source, "数据编辑");
            }
        }