示例#1
0
 public override void OnClick()
 {//XZQLocation
     if (_hook == null)
     {
         return;
     }
     if (_hook.MainUserControl == null)
     {
         return;
     }
     try
     {
         DevComponents.AdvTree.AdvTree  xzqTree     = _hook.XZQTree;
         Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef;
         FrmSheetMapUserSet_ZTbat       batZT       = new FrmSheetMapUserSet_ZTbat(_AppHk.ArcGisMapControl, pAppFormRef.MainForm, xzqTree.SelectedNode.Text);
         batZT.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志
         if (!(batZT.ShowDialog(pAppFormRef.MainForm) == DialogResult.OK))
         {
             return;
         }
         IMap pMap = batZT.Map;
         if (pMap.LayerCount == 0)
         {
             SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。");
             return;
         }
         GeoPageLayout pGL = new GeoPageLayout(_hook.ArcGisMapControl.Map, batZT.GetScale, batZT.GetZTMC, xzqTree.SelectedNode);
         pGL.typePageLayout = 6;
         pGL.MapOut();
     }
     catch
     { }
 }
示例#2
0
 public override void OnClick()
 {//XZQLocation
     if (_hook == null)
     {
         return;
     }
     if (_hook.MainUserControl == null)
     {
         return;
     }
     try
     {
         DevComponents.AdvTree.AdvTree xzqTree = _hook.XZQTree;
         IGeometry xzqGeo = ModGetData.getExtentByXZQ(xzqTree.SelectedNode);
         if (xzqGeo == null)
         {
             SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到相应的行政区范围!");
             return;
         }
         Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef;
         FrmSheetMapUserSet_ZTbat       batZT       = new FrmSheetMapUserSet_ZTbat(_AppHk.ArcGisMapControl, pAppFormRef.MainForm, xzqTree.SelectedNode.Text);
         batZT.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志
         if (!(batZT.ShowDialog(pAppFormRef.MainForm) == DialogResult.OK))
         {
             return;
         }
         if (this.WriteLog)
         {
             Plugin.LogTable.Writelog(this._Caption);
         }
         IMap pMap = batZT.Map;
         if (pMap.LayerCount == 0)
         {
             SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。");
             return;
         }
         GeoPageLayout pGL = new GeoPageLayout(pMap, xzqGeo, batZT.GetScale, xzqTree.SelectedNode.Text, 1);
         pGL.WriteLog       = WriteLog;//ygc 2012-9-12 是否写日志
         pGL.typePageLayout = 4;
         pGL.MapOut();
     }
     catch (Exception ex)
     {
         SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message);
     }
 }
示例#3
0
        public override void OnClick()
        {//XZQLocation
            if (_hook == null)
            {
                return;
            }
            if (_hook.MainUserControl == null)
            {
                return;
            }
            DevComponents.AdvTree.AdvTree xzqTree = _hook.XZQTree;
            IGeometry xzqGeo = ModGetData.getExtentByXZQ(xzqTree.SelectedNode);

            if (xzqGeo == null)
            {
                SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到相应的行政区范围!");
                return;
            }
            try
            {
                Plugin.Application.IAppFormRef pAppFormRef = _AppHk as Plugin.Application.IAppFormRef;
                FrmSheetMapUserSet_ZTbat       batZT       = new FrmSheetMapUserSet_ZTbat(_AppHk.ArcGisMapControl, pAppFormRef.MainForm, xzqTree.SelectedNode.Text);
                batZT.WriteLog = WriteLog;//ygc 2012-9-12 是否写日志
                if (!(batZT.ShowDialog(pAppFormRef.MainForm) == DialogResult.OK))
                {
                    return;
                }
                if (this.WriteLog)
                {
                    Plugin.LogTable.Writelog("出" + this._Caption);
                }
                IMap pMap = batZT.Map;
                if (pMap.LayerCount == 0)
                {
                    SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到图层。");
                    return;
                }
                string xzqdmFD = "";
                //构造晕线和渲染图层
                IFeatureClass xzqFC = ModGetData.getFCByXZQ(xzqTree.SelectedNode, ref xzqdmFD);
                if (xzqFC != null && xzqdmFD != null)
                {
                    ILayer hachureLyr = GeoPageLayoutFn.createHachureLyr(xzqFC, xzqdmFD, xzqTree.SelectedNode.Name);
                    if (hachureLyr != null)
                    {
                        IMapLayers  pMapLayers  = pMap as IMapLayers;
                        IGroupLayer pGroupLayer = pMap.get_Layer(0) as IGroupLayer;
                        if (pGroupLayer != null)
                        {
                            pMapLayers.InsertLayerInGroup(pGroupLayer, hachureLyr, false, 0);
                        }
                    }
                }
                GeoPageLayout pGL = new GeoPageLayout(pMap, xzqGeo, batZT.GetScale, xzqTree.SelectedNode.Text, 1);
                pGL.WriteLog       = WriteLog;//ygc 2012-9-12 是否写日志
                pGL.typePageLayout = 5;
                pGL.MapOut();
            }
            catch (Exception ex)
            {
                SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", ex.Message);
            }
        }