示例#1
0
        public override void OnCreate(Plugin.Application.IApplicationRef hook)
        {
            if (hook == null)
            {
                return;
            }
            _AppHk = hook as Plugin.Application.IAppGisUpdateRef;
            if (_AppHk.MapControl == null)
            {
                return;
            }
            m_pAppForm = _AppHk as Plugin.Application.IAppFormRef;

            m_pActiveView = _AppHk.MapControl.Map as IActiveView;

            m_pActiveViewEvents = m_pActiveView as IActiveViewEvents_Event;
            m_pScreenDisplay    = m_pActiveView.ScreenDisplay;
            try
            {
                m_pActiveViewEvents.AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(m_pActiveViewEvents_AfterDraw);
            }
            catch
            {
            }
        }
示例#2
0
 public override void OnClick()
 {
     Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
     SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
     if (pBar.m_WorkSpace == null)
     {
         pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
     }
     if (pBar.ListDataNodeKeys == null)
     {
         pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
     }
     if (_AppHk == null)
     {
         return;
     }
     /// ZQ 2011 1125 modify
     if (m_frmSelectBuffer == null)
     {
         m_frmSelectBuffer              = new frmSelectBuffer(_AppHk.ArcGisMapControl, m_pAppForm.MainForm);
         m_frmSelectBuffer.WriteLog     = this.WriteLog;
         m_frmSelectBuffer._pMapControl = _AppHk.MapControl;
         m_frmSelectBuffer.FormClosed  += new System.Windows.Forms.FormClosedEventHandler(m_frmSelectBuffer_FormClosed);
         m_frmSelectBuffer.QueryBar     = pBar;
         m_frmSelectBuffer.Show();
     }
     else
     {
         m_frmSelectBuffer.Activate();
     }
 }
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            if (_AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            IMap pMap = _AppHk.MapControl.Map;

            if (frmSQL != null)
            {
                frmSQL.Close();
                frmSQL = null;
            }
            frmSQL           = new FrmSQLQuery(_AppHk.MapControl, Plugin.ModuleCommon.TmpWorkSpace);
            frmSQL._QueryBar = pBar;
            frmSQL.Show((_AppHk as Plugin.Application.IAppFormRef).MainForm);
            if (WriteLog)
            {
                Plugin.LogTable.Writelog("自定义查询"); //ygc 2012-9-14 写日志
            }
        }
示例#4
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            ImportPolygonQueryToolClass pTool = _cmd as ImportPolygonQueryToolClass;

            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            //if (_AppHk.CurrentControl is IMapControl2)
            //{
            //    _AppHk.MapControl.CurrentTool = _tool;
            //}
            //else
            //{
            //    _AppHk.PageLayoutControl.CurrentTool = _tool;
            //}

            _AppHk.CurrentTool = this.Name;
        }
示例#5
0
        /// <summary>
        /// Occurs when this tool is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }
            m_pAppForm = hook as Plugin.Application.IAppFormRef;
            Plugin.Application.IAppGisUpdateRef appHK = hook as Plugin.Application.IAppGisUpdateRef;
            m_hookHelper.Hook = appHK.MapControl.Object;
            m_MapControl      = appHK.MapControl;
            //m_pActiveView = m_hookHelper.FocusMap as IActiveView;

            //m_pActiveViewEvents = m_pActiveView as IActiveViewEvents_Event;
            //m_pScreenDisplay = m_pActiveView.ScreenDisplay;

            //try
            //{
            //    m_pActiveViewEvents.AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(m_pActiveViewEvents_AfterDraw);

            //}
            //catch
            //{
            //}
            // TODO:  Add ToolEvnelopeExport.OnCreate implementation
        }
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            ControlsMapIdentify pTool = _cmd as ControlsMapIdentify;

            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            if (_tool == null || _cmd == null || _AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            _AppHk.MapControl.CurrentTool = _tool;
            _AppHk.CurrentTool            = this.Name;
        }
示例#7
0
        /// <summary>
        /// Occurs when this command is created
        /// </summary>
        /// <param name="hook">Instance of the application</param>
        public override void OnCreate(object hook)
        {
            if (hook == null)
            {
                return;
            }

            if (m_hookHelper == null)
            {
                m_hookHelper = new HookHelperClass();
            }

            m_pAppForm = hook as Plugin.Application.IAppFormRef;
            Plugin.Application.IAppGisUpdateRef appHK = hook as Plugin.Application.IAppGisUpdateRef;
            m_hookHelper.Hook = appHK.MapControl.Object;
            m_pActiveView     = m_hookHelper.FocusMap as IActiveView;

            m_pActiveViewEvents = m_pActiveView as IActiveViewEvents_Event;
            m_pScreenDisplay    = m_pActiveView.ScreenDisplay;
            try
            {
                m_pActiveViewEvents.AfterDraw += new IActiveViewEvents_AfterDrawEventHandler(m_pActiveViewEvents_AfterDraw);
            }
            catch
            {
            }
            // TODO:  Add other initialization code
        }
示例#8
0
 public override void OnClick()
 {
     Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
     SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
     if (pBar.m_WorkSpace == null)
     {
         pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
     }
     if (pBar.ListDataNodeKeys == null)
     {
         pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
     }
     if (_AppHk == null)
     {
         return;
     }
     if (m_frm != null)
     {
         m_frm = null;
     }
     m_frm          = new frmXYBufferset(_AppHk.MapControl, m_pAppForm.MainForm);
     m_frm.WriteLog = this.WriteLog;
     m_frm.QueryBar = pBar;
     m_frm.Show();
 }
示例#9
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            PolygonBufferQueryToolClass pTool = _cmd as PolygonBufferQueryToolClass;

            pTool.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志
            pTool.GetQueryBar(pBar);
            _cmd.OnClick();
            if (_AppHk.CurrentControl is IMapControl2)
            {
                _AppHk.MapControl.CurrentTool = _tool;
            }
            else
            {
                _AppHk.PageLayoutControl.CurrentTool = _tool;
            }

            _AppHk.CurrentTool = this.Name;
        }
 public override void OnCreate(Plugin.Application.IApplicationRef hook)
 {
     if (hook == null)
     {
         return;
     }
     m_Hook = hook as Plugin.Application.IAppGisUpdateRef;
 }
示例#11
0
 public override void OnCreate(Plugin.Application.IApplicationRef hook)
 {
     if (hook == null)
     {
         return;
     }
     _AppHk    = hook as Plugin.Application.IAppGisUpdateRef;
     _hook     = hook as Plugin.Application.AppGidUpdate;
     m_xzqTree = _hook.XZQTree;
 }
示例#12
0
 public override void OnCreate(Plugin.Application.IApplicationRef hook)
 {
     if (hook == null)
     {
         return;
     }
     _AppHk = hook as Plugin.Application.IAppGisUpdateRef;
     if (_AppHk.CurrentControl == null)
     {
         return;
     }
 }
示例#13
0
 public override void OnCreate(Plugin.Application.IApplicationRef hook)
 {
     if (hook == null)
     {
         return;
     }
     _AppHk = hook as Plugin.Application.IAppGisUpdateRef;
     if (_AppHk.MapControl == null)
     {
         return;
     }
     m_pAppForm = _AppHk as Plugin.Application.IAppFormRef;
 }
示例#14
0
        public override void OnCreate(Plugin.Application.IApplicationRef hook)
        {
            if (hook == null)
            {
                return;
            }
            _AppHk = hook as Plugin.Application.IAppGisUpdateRef;
            if (_AppHk.CurrentControl == null)
            {
                return;
            }

            m_pTool    = new GeoDataCenterFunLib.ControlsMapMeasureToolDefClass() as ESRI.ArcGIS.SystemUI.ITool;
            m_pCommand = m_pTool as ESRI.ArcGIS.SystemUI.ICommand;
            m_pCommand.OnCreate(_AppHk);
        }
示例#15
0
 /// <summary>
 /// 在退出系统前如正在处理数据应提示
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     Plugin.Application.IAppGisUpdateRef pApp = ModData.v_AppGisUpdate as Plugin.Application.IAppGisUpdateRef;
     if (pApp == null)
     {
         return;
     }
     if (pApp.CurrentThread != null)
     {
         pApp.CurrentThread.Suspend();
         if (SysCommon.Error.ErrorHandle.ShowFrmInformation("确定", "取消", "当前任务正在进行,是否终止退出?") == true)
         {
             pApp.CurrentThread.Resume();
             pApp.CurrentThread.Abort();
         }
         else
         {
             pApp.CurrentThread.Resume();
             e.Cancel = true;
         }
     }
 }
示例#16
0
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (pBar.ListDataNodeKeys == null)
            {
                pBar.ListDataNodeKeys = Plugin.ModuleCommon.ListUserdataPriID;
            }
            if (_AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            IMap pMap = _AppHk.MapControl.Map;

            string strDMFL = "", strDM = "";

            List <ILayer>        pListLayers = null;
            List <IFeatureClass> pListFeatureClasses = null;
            List <string>        pListLayerNames = null;
            List <string>        pListNodeKeys = null;

            SysCommon.ModSysSetting.CopyConfigXml(Plugin.ModuleCommon.TmpWorkSpace, "查询配置", ModQuery.m_QueryPath); //added by chulili 20111110先从业务库拷贝配置文件
            try
            {                                                                                                      //获取地名地物类
                ModQuery.GetPlaceNameQueryConfig(pMap, out pListNodeKeys, out pListLayers, out pListFeatureClasses, out pListLayerNames, out strDM);
                //检查地名字段
                if (pListFeatureClasses == null)
                {
                    MessageBox.Show("找不到地名数据,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                if (pListFeatureClasses.Count == 0)
                {
                    MessageBox.Show("找不到地名数据,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                for (int i = 0; i < pListFeatureClasses.Count; i++)
                {
                    IFeatureClass pTmpFeaCls = pListFeatureClasses[i];
                    if (pTmpFeaCls.FindField(strDM) < 0)
                    {
                        MessageBox.Show("找不到地名数据名称属性,请检查配置文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                frmQueryDomain fmQD = new frmQueryDomain(Plugin.ModuleCommon.TmpWorkSpace, _pAppForm.MainForm, _AppHk.MapControl, pListNodeKeys, pListLayers, pListFeatureClasses, pListLayerNames, strDM);
                fmQD.WriteLog = this.WriteLog;
                fmQD.QueryBar = pBar;
                fmQD.Show(_pAppForm.MainForm);
                //IQueryFilter pQF = new QueryFilterClass();
                //pQF.WhereClause = fmQD.SqlWhere;
                //frmQuery fmQ = new frmQuery(_AppHk.MapControl);
                ////用查询地物类,查询条件 填充查询窗体
                //if (fmQD._QueryTag.Equals("XZ"))
                //{
                //    fmQ.FillData(pXZFeaClass, pQF,false);
                //}
                //else
                //{
                //    fmQ.FillData(pZRFeaClass, pQF,false);
                //}
                //fmQ.Show((_AppHk as Plugin.Application.IAppFormRef).MainForm);
            }
            catch (Exception ex)
            {
                ErrorHandle.ShowFrmErrorHandle("提示", ex.Message);
            }
        }
        public override void OnClick()
        {
            Plugin.Application.IAppGisUpdateRef phook = _AppHk as Plugin.Application.IAppGisUpdateRef;
            SysCommon.BottomQueryBar            pBar  = phook.QueryBar;
            if (pBar.m_WorkSpace == null)
            {
                pBar.m_WorkSpace = Plugin.ModuleCommon.TmpWorkSpace;
            }
            if (_AppHk == null)
            {
                return;
            }
            if (_AppHk.MapControl == null)
            {
                return;
            }
            IMap pMap = _AppHk.MapControl.Map;

            if (frmSQL != null)
            {
                frmSQL.Close();
                frmSQL = null;
            }
            if (WriteLog)
            {
                Plugin.LogTable.Writelog("打开查询方案"); //ygc 2012-9-14 写日志
            }
            SysCommon.CProgress vProgress = new SysCommon.CProgress("进度条");
            vProgress.EnableCancel = true;
            vProgress.EnableUserCancel(true);

            vProgress.ShowDescription = false;
            vProgress.FakeProgress    = true;
            vProgress.TopMost         = true;
            //vProgress.ShowProgress();
            vProgress.SetProgress("开始查询");
            FrmOpenSQLCondition newfrm = new FrmOpenSQLCondition(Plugin.ModuleCommon.TmpWorkSpace);

            newfrm.m_TableName    = "SQLSOLUTION";
            newfrm.m_showAllLayer = true;
            if (newfrm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            vProgress.ShowProgress();
            string strSQL    = newfrm.m_Condition;
            string layerName = newfrm.m_LayerName;

            if (strSQL == "")
            {
                MessageBox.Show("未选择查看的查询方案!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
                return;
            }
            IFeatureLayer pFeatureLayer = GetLayerByName(layerName, pMap);

            if (pFeatureLayer == null)
            {
                MessageBox.Show("当前地图无该查询方案图层!", "提示");
                return;
            }
            //构造查询过滤器
            IQueryFilter pQueryFilter = new QueryFilterClass();

            pQueryFilter.WhereClause = strSQL;
            esriSelectionResultEnum pSelectionResult = esriSelectionResultEnum.esriSelectionResultNew;

            vProgress.SetProgress("正在查询符合条件的结果");
            pBar.m_pMapControl = _AppHk.MapControl;
            pBar.EmergeQueryData(_AppHk.MapControl.Map, pFeatureLayer, pQueryFilter, pSelectionResult, vProgress);
            vProgress.Close();

            try
            {
                DevComponents.DotNetBar.Bar pBar0 = pBar.Parent.Parent as DevComponents.DotNetBar.Bar;
                if (pBar0 != null)
                {
                    pBar0.AutoHide = false;
                    //pBar0.SelectedDockTab = 1;
                    int tmpindex = pBar0.Items.IndexOf("dockItemDataCheck");
                    pBar0.SelectedDockTab = tmpindex;
                }
            }
            catch
            { }
        }