//结束编辑
        private void barButtonItem15_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                ICommand m_stopEditCom = new StopEditCommandClass();
                m_stopEditCom.OnCreate(Variable.pMapFrm.mainMapControl.Object);
                m_stopEditCom.OnClick();
                Variable.pMapFrm.mainMapControl.CurrentTool  = null;
                Variable.pMapFrm.mainMapControl.MousePointer = esriControlsMousePointer.esriPointerDefault;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "异常");
            }

            //设置数据管理中要素管理未开始编辑状态,图层选择、添加要素、选择编辑要素、要素属性编辑、结束编辑等功能变成灰色,使得无法进行操作
            barEditItem1.Enabled    = false;
            barButtonItem12.Enabled = false;
            barButtonItem14.Enabled = false;
            barButtonItem13.Enabled = false;
            barButtonItem15.Enabled = false;
            barButtonItem4.Enabled  = false;
            barButtonItem20.Enabled = false;
            barButtonItem22.Enabled = false;
            barButtonItem21.Enabled = false;
            barButtonItem23.Enabled = false;
        }
Example #2
0
        //停止编辑
        private void btnEndEdit_Click(object sender, EventArgs e)
        {
            ChangeButtonState(false);
            axMap.CurrentTool   = null;
            label1.Visible      = false;
            cmbSelLayer.Visible = false;
            button1.Visible     = false;
            for (int i = 0; i < axMap.LayerCount; i++)
            {
                axMap.Map.Layer[i].Visible = true;
            }
            //try
            //{
            ICommand m_stopEditCom = new StopEditCommandClass();

            m_stopEditCom.OnCreate(axMap.Object);
            m_stopEditCom.OnClick();
            ChangeButtonState(false);
            axMap.CurrentTool  = null;
            axMap.MousePointer = esriControlsMousePointer.esriPointerDefault;
            axMap.ActiveView.Refresh();

            //}
            //catch (Exception ex)
            //{
            //}
        }