Esempio n. 1
0
 public void ApplyMapTemplate(IPageLayout ipageLayout_0)
 {
     this.GetFocusMapFrame(ipageLayout_0);
     ((ipageLayout_0 as IActiveView).FocusMap as IMapClipOptions).ClipType = esriMapClipType.esriMapClipNone;
     if ((ipageLayout_0 as IActiveView).FocusMap is IMapAutoExtentOptions)
     {
         ((ipageLayout_0 as IActiveView).FocusMap as IMapAutoExtentOptions).AutoExtentType =
             esriExtentTypeEnum.esriExtentDefault;
     }
     if (this.FixDataRange)
     {
         IEnvelope extent = ((ipageLayout_0 as IActiveView).FocusMap as IActiveView).Extent;
         this.mapTemplate_0.CreateTKByRect(ipageLayout_0 as IActiveView, extent);
     }
     else if (this.IsMapNo)
     {
         this.mapTemplate_0.CreateTrapezoidTK(ipageLayout_0,
                                              MapNoAssistantFactory.CreateMapNoAssistant(this.string_0));
     }
     else if (this.mapTemplate_0.MapFramingType == MapFramingType.StandardFraming)
     {
         PointClass class2 = new PointClass
         {
             X = this.double_0,
             Y = this.double_1
         };
         this.mapTemplate_0.CreateTKN(ipageLayout_0 as IActiveView, class2);
     }
     (ipageLayout_0 as IGraphicsContainerSelect).UnselectAllElements();
 }
Esempio n. 2
0
 public bool CanApply()
 {
     if (this.rdoMapNo.Checked)
     {
         MapNoAssistant assistant = MapNoAssistantFactory.CreateMapNoAssistant(this.txtMapNo.Text);
         if (assistant == null)
         {
             MessageService.Current.Warn("图号输入不正确!");
             return(false);
         }
         if (!assistant.Validate())
         {
             MessageService.Current.Warn("图号输入不正确!");
             return(false);
         }
         return(true);
     }
     if (this.rdoLeftDown.Checked)
     {
         try
         {
             double.Parse(this.txtJD.Text);
             double.Parse(this.txtWD.Text);
             double.Parse(this.txtJC.Text);
             double.Parse(this.txtWC.Text);
             double.Parse(this.txtScale.Text);
             return(true);
         }
         catch
         {
             return(false);
         }
     }
     if (this.rdoFieldSearch.Checked)
     {
         if (cmbIndexMap.SelectedIndex < 0)
         {
             MessageService.Current.Warn("请选择索引图!");
             return(false);
         }
         //if (string.IsNullOrEmpty(txtSearchKey.EditValue.ToString()))
         //{
         //    MessageService.Current.Warn("请输入搜素关键字!");
         //    return false;
         //}
         if (lstIndexFeatures.SelectedIndex < 0)
         {
             MessageService.Current.Warn("请选择搜索到的索引要素!");
             return(false);
         }
         this.txtSearchKey.Tag = this.lstIndexFeatures.SelectedItem;
         return(true);
     }
     try
     {
         double.Parse(this.txtLeftUpperX.Text);
         double.Parse(this.txtLeftUpperY.Text);
         double.Parse(this.txtRightUpperX.Text);
         double.Parse(this.txtRightUpperY.Text);
         double.Parse(this.txtRightLowX.Text);
         double.Parse(this.txtRightLowY.Text);
         double.Parse(this.txtLeftLowX.Text);
         double.Parse(this.txtLeftLowY.Text);
         return(true);
     }
     catch
     {
         return(false);
     }
 }