コード例 #1
0
        private void StartSection()
        {
            DMCoordForm dMCoordForm = new DMCoordForm()
            {
                pPolyline = _sectLine
            };

            if (dMCoordForm.ShowDialog() == DialogResult.OK)
            {
                _sectLine = dMCoordForm.pPolyline;
            }

            ISimpleLineSymbol simpleLineSymbolClass = new SimpleLineSymbol();
            IRgbColor         rgbColorClass         = ColorManage.CreatColor(255, 0, 0) as IRgbColor;

            simpleLineSymbolClass.Color = (rgbColorClass);
            simpleLineSymbolClass.Width = 2;

            if (_sectLine != null)
            {
                CommonUtils.NewLineElement(_context.FocusMap, _sectLine);
                double num = _sectLine.FromPoint.X;
                string str = num.ToString("f2");
                num = _sectLine.FromPoint.Y;
                string   str1        = string.Concat("X =", str, " Y=", num.ToString("f2"));
                IElement textElement = this.GetTextElement(0, str1, _sectLine.FromPoint);
                ((IGraphicsContainer)_context.ActiveView).AddElement(textElement, 0);
                num = _sectLine.ToPoint.X;
                string str2 = num.ToString("f2");
                num         = _sectLine.ToPoint.Y;
                str1        = string.Concat("X =", str2, " Y=", num.ToString("f2"));
                textElement = this.GetTextElement(0, str1, _sectLine.ToPoint);
                ((IGraphicsContainer)_context.ActiveView).AddElement(textElement, 0);
                this._lineFeedback = null;
                SectionViewFrm sectionViewFrm = new SectionViewFrm(SectionViewFrm.SectionType.SectionTypeTransect,
                                                                   _context, _plugin.PipeConfig);
                sectionViewFrm.PutBaseLine(_sectLine);
                sectionViewFrm.ShowDialog();
            }
        }
コード例 #2
0
 public override void OnMouseUp(int button, int shift, int x, int y)
 {
     if (button == 2)
     {
         this.m_SectionControl.m_arrSortInfo.Clear();
         this.GetSortInfos(this.m_SectionControl.m_arrSortInfo);
         bool flag;
         if (this.m_SectionControl.m_arrSortInfo.Count == 0)
         {
             MessageBox.Show(@"没有选择到管线!", @"纵断面分析");
         }
         else if (!(flag = !this.method_1(this.m_SectionControl.m_arrSortInfo)))
         {
             MessageBox.Show(@"有三通情况不能分析!", @"纵断面分析");
         }
         else if (!this.method_3(this.m_SectionControl.m_arrSortInfo))
         {
             MessageBox.Show(@"所选择的管线不是连接的!", @"纵断面分析");
         }
         else
         {
             if (flag)
             {
                 SectionViewFrm sectionViewFrm = new SectionViewFrm(
                     SectionViewFrm.SectionType.SectionTypeVersect, _context, _plugin.PipeConfig);
                 sectionViewFrm.GetSelectedData();
                 sectionViewFrm.ShowDialog();
             }
             else
             {
                 MessageBox.Show(@"没有首尾相接选择管线!", @"纵断面分析");
             }
             this._context.FocusMap.ClearSelection();
             this._context.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, _context.ActiveView.Extent);
             this.m_SectionControl.Clear();
         }
     }
 }