public override void OnClick()
        {
            Exception eError;

            SubControl.UCDataSourceManger pUCdatasource = _hook.MainForm.Controls[0] as SubControl.UCDataSourceManger;
            if (pUCdatasource == null)
            {
                return;
            }
            pUCdatasource.AutoMathLayerConfig();
        }
Esempio n. 2
0
        public override void OnClick()
        {
            Exception eError;

            SubControl.UCDataSourceManger pUCdatasource = _hook.MainForm.Controls[0] as SubControl.UCDataSourceManger;
            if (pUCdatasource == null)
            {
                return;
            }
            pUCdatasource.SetLayerAttributes();
        }
Esempio n. 3
0
        public override void OnClick()
        {
            Exception eError;

            if (_hook == null)
            {
                return;
            }
            if (_hook.MainForm == null)
            {
                return;
            }
            SubControl.UCDataSourceManger pUcDataSource = _hook.MainForm.Controls[0] as SubControl.UCDataSourceManger;
            SysCommon.CProgress           vProgress     = new SysCommon.CProgress("保存图层目录");
            vProgress.EnableCancel    = false;
            vProgress.ShowDescription = true;
            vProgress.FakeProgress    = true;
            vProgress.TopMost         = true;
            vProgress.ShowProgress();

            if (pUcDataSource != null)
            {
                vProgress.SetProgress("保存图层顺序");
                pUcDataSource.DealLayerOrderID();            //对map中图层的顺序号进行处理,确保前后顺序正确
                pUcDataSource.SetOrderIDofAllLayer("Layer"); //对xml中的图层顺序号进行重新赋值,确保xml中所有顺序号前后关系正确,且都是整型
                pUcDataSource.RefreshOrderIDofAllLayer();
            }
            vProgress.SetProgress("保存图层目录配置文件");
            GeoLayerTreeLib.LayerManager.ModuleMap.SaveLayerTree(Plugin.ModuleCommon.TmpWorkSpace, ModPublicFun._layerTreePath);
            if (SysCommon.ModSysSetting.IsLayerTreeChanged)
            {
                SysCommon.ModSysSetting.IsConfigLayerTreeChanged = true;
            }
            SysCommon.ModSysSetting.IsLayerTreeChanged = false;
            vProgress.SetProgress("保存为初始状态");
            SaveInitState();
            if (this.WriteLog)
            {
                Plugin.LogTable.Writelog("目录" + Caption);//xisheng 2011.07.09 增加日志
            }
            vProgress.Close();
            MessageBox.Show("目录保存成功!");
        }
Esempio n. 4
0
        public override void OnClick()
        {
            Exception eError;

            SubControl.UCDataSourceManger pUCdatasource = _hook.MainForm.Controls[0] as SubControl.UCDataSourceManger;
            if (pUCdatasource == null)
            {
                return;
            }
            //弹出对话框供用户选择导入的xml文件
            OpenFileDialog pOpenFileDlg = new OpenFileDialog();

            pOpenFileDlg.Title  = "选择图层目录";
            pOpenFileDlg.Filter = "XML数据(*.xml)|*.xml";
            if (pOpenFileDlg.ShowDialog() == DialogResult.OK)
            {
                if (this.WriteLog)
                {
                    Plugin.LogTable.Writelog("目录" + Caption);//xisheng 2011.07.09 增加日志
                }
                string xmlpath = pOpenFileDlg.FileName;
                //added by chulili 20110729 判断导入目录的文件格式是否正确
                if (!GeoLayerTreeLib.LayerManager.ModuleMap.IsLayerTreeXmlRight(xmlpath))
                {
                    MessageBox.Show("选择的xml文件格式不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (GeoLayerTreeLib.LayerManager.ModuleMap.SaveLayerTree(Plugin.ModuleCommon.TmpWorkSpace, xmlpath))
                {   //调用函数,将本地xml形式的图层目录导入到数据库中
                    SysCommon.ModSysSetting.CopyLayerTreeXmlFromDataBase(Plugin.ModuleCommon.TmpWorkSpace, ModPublicFun._layerTreePath);
                    //changed by chulili 20110722 导入后刷新图层RefreshLayerTree-》RefreshLayerTreeEx
                    pUCdatasource.RefreshLayerTreeEx();
                    SysCommon.ModSysSetting.IsConfigLayerTreeChanged = true;
                    MessageBox.Show("导入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("导入失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Esempio n. 5
0
        public override void OnClick()
        {
            Exception eError;

            SubControl.UCDataSourceManger pUCdatasource = _hook.MainForm.Controls[0] as SubControl.UCDataSourceManger;
            if (pUCdatasource == null)
            {
                return;
            }
            if (this._Checked == false)
            {
                this._Checked = true;
                pUCdatasource.ChangeLayerVisible(this._Checked);
                if (this.WriteLog)
                {
                    Plugin.LogTable.Writelog("目录" + Caption);//xisheng 2011.07.09 增加日志
                }
            }
            else
            {
                this._Checked = false;
                pUCdatasource.ChangeLayerVisible(this._Checked);
            }
        }