Example #1
0
        //添加数据
        private void barButtonItem35_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ICommand cmd = new ControlsAddDataCommand();

            cmd.OnCreate(this.axMapControl1.Object);
            cmd.OnClick();
        }
        /// <summary>
        /// 添加数据
        /// </summary>
        public void AddData()
        {
            int currentLayerCount = this.AxMapControl.LayerCount;

            ICommand pCommand = new ControlsAddDataCommand();
            pCommand.OnCreate(this.AxMapControl.Object);
            pCommand.OnClick();
        }
Example #3
0
        /// <summary>
        /// 添加数据
        /// </summary>
        public void AddData()
        {
            int currentLayerCount = this.AxMapControl.LayerCount;

            ICommand pCommand = new ControlsAddDataCommand();

            pCommand.OnCreate(this.AxMapControl.Object);
            pCommand.OnClick();
        }
Example #4
0
        private void addFile(TextBox tx)
        {
            TextBoxGlob = tx;
            initMapEvents();
            //var layers = SelectDataUtils.OpenLayers();
            axMapControl2.ClearLayers();
            ICommand cmd = new ControlsAddDataCommand();

            cmd.OnCreate(axMapControl2.Object);
            cmd.OnClick();
        }
Example #5
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            try
            {
                ClsGlobal.GetSelectedMapAndLayer(m_pTocCtl, ref m_pMap, ref m_pLayer);
                if (m_pMap == null || m_pLayer == null)
                {
                    return;
                }


                IMap pMapHiden = m_HidenMapCtrl.Map;
                pMapHiden.ClearLayers();

                ICommand pCmd = new ControlsAddDataCommand();
                pCmd.OnCreate(m_HidenMapCtrl);
                pCmd.OnClick();

                ILayer pLayerSrc = null;
                if (pMapHiden.LayerCount > 0)
                {
                    pLayerSrc = pMapHiden.get_Layer(0);
                    if (pLayerSrc != null)
                    {
                        IDataset   pDatasetSrc         = pLayerSrc as IDataset;
                        IWorkspace pWksSrc             = pDatasetSrc.Workspace;
                        LibCerMap.ClsGDBDataCommon cls = new LibCerMap.ClsGDBDataCommon();
                        cls.SetDataSource(m_pLayer, pLayerSrc);
                        cls.RepairDataSource(m_pMap, pWksSrc);
                        m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);
                        m_pTocCtl.Update();
                    }
                }
                pMapHiden.ClearLayers();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            #endregion
        }
Example #6
0
 private void menuAddGdb_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.SystemUI.ICommand cmd = new ControlsAddDataCommand();
     cmd.OnCreate(this.axMapControl1.Object);
     cmd.OnClick();
 }