public bool HandleCommand(string string_1)
        {
            bool flag;

            if (!this.bool_0)
            {
                try
                {
                    string_1 = string_1.Trim();
                    if (string_1.Length != 0)
                    {
                        string[] strArrays  = string_1.Split(new char[] { ',' });
                        double   num        = 0;
                        IPoint   pointClass = new ESRI.ArcGIS.Geometry.Point();
                        if ((int)strArrays.Length < 2)
                        {
                            this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                            flag = true;
                            return(flag);
                        }
                        else
                        {
                            num = Convert.ToDouble(strArrays[0]);
                            pointClass.PutCoords(num, Convert.ToDouble(strArrays[1]));
                            if ((int)strArrays.Length == 3)
                            {
                                pointClass.Z = Convert.ToDouble(strArrays[2]);
                            }
                            if (this.int_0 == 1)
                            {
                                this.bool_0 = true;
                            }
                            SketchShareEx.SketchMouseDown(pointClass, this._appContext.MapControl.Map as IActiveView,
                                                          Editor.CurrentEditTemplate.FeatureLayer);
                            ThreePointArcCommandFlow int0 = this;
                            int0.int_0 = int0.int_0 + 1;
                        }
                    }
                    else
                    {
                        flag = false;
                        return(flag);
                    }
                }
                catch
                {
                    this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                    flag = true;
                    return(flag);
                }
                this.ShowCommandLine();
                flag = true;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Example #2
0
 private void method_0()
 {
     SketchShareEx.EndSketch(false, this._appContext.MapControl.Map as IActiveView,
                             Editor.CurrentEditTemplate.FeatureLayer);
     this.int_0 = 0;
     this._appContext.ShowCommandString("完成", CommandTipsType.CTTInput);
     this.Reset();
     Editor.EnableUndoRedo = true;
 }
Example #3
0
        public bool HandleCommand(string string_2)
        {
            bool flag;

            char[]   chrArray;
            string[] strArrays;
            double   num;
            double   num1;
            double   num2;
            IPoint   pointClass;

            this.bool_0 = false;
            if (string_2 == "ESC")
            {
                this.icommandFlow_0 = null;
                this.Cancel();
                flag = true;
            }
            else if (this.int_0 != 0)
            {
                if (this.icommandFlow_0 != null)
                {
                    if (!this.icommandFlow_0.IsFinished)
                    {
                        flag = this.icommandFlow_0.HandleCommand(string_2);
                        return(flag);
                    }
                    if ((this.icommandFlow_0 is ThreePointArcCommandFlow
                        ? true
                        : this.icommandFlow_0 is ConstructTangentArcCommandFlow))
                    {
                        if (SketchToolAssist.Feedback is INewPolylineFeedback)
                        {
                            (SketchToolAssist.Feedback as INewPolylineFeedback).ChangeLineType(enumLineType.LTLine);
                        }
                        if (SketchToolAssist.Feedback is INewPolygonFeedbackEx)
                        {
                            (SketchToolAssist.Feedback as INewPolygonFeedbackEx).ChangeLineType(enumLineType.LTLine);
                        }
                    }
                    this.icommandFlow_0 = null;
                }
                try
                {
                    this.string_1 = string_2.Trim();
                    if (this.string_1.Length != 0)
                    {
                        if (this.string_1.Length != 1)
                        {
                            string string1 = this.string_1;
                            chrArray      = new char[] { ',' };
                            strArrays     = string1.Split(chrArray);
                            this.string_1 = "";
                            num           = 0;
                            num1          = 0;
                            num2          = 0;
                            pointClass    = new ESRI.ArcGIS.Geometry.Point();
                            if ((int)strArrays.Length < 2)
                            {
                                this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                            }
                            else
                            {
                                SketchCommandFlow int0 = this;
                                int0.int_0 = int0.int_0 + 1;
                                num        = Convert.ToDouble(strArrays[0]);
                                pointClass.PutCoords(num, Convert.ToDouble(strArrays[1]));
                                if ((int)strArrays.Length >= 3)
                                {
                                    pointClass.Z = Convert.ToDouble(strArrays[2]);
                                }
                                SketchShareEx.SketchMouseDown(pointClass, this._appContext.MapControl.Map as IActiveView,
                                                              Editor.CurrentEditTemplate.FeatureLayer);
                            }
                        }
                        else
                        {
                            string lower = this.string_1.ToLower();
                            if (lower != null)
                            {
                                switch (lower)
                                {
                                case "c":
                                {
                                    if (SketchToolAssist.Feedback is INewPolylineFeedback)
                                    {
                                        (SketchToolAssist.Feedback as INewPolylineFeedback).Close();
                                    }
                                    this.method_0();
                                    break;
                                }

                                case "u":
                                {
                                    if (SketchToolAssist.Feedback is IOperation)
                                    {
                                        (SketchToolAssist.Feedback as IOperation).Undo();
                                    }
                                    SketchCommandFlow sketchCommandFlow = this;
                                    sketchCommandFlow.int_0 = sketchCommandFlow.int_0 - 1;
                                    break;
                                }

                                case "r":
                                {
                                    if (SketchToolAssist.Feedback is IOperation)
                                    {
                                        (SketchToolAssist.Feedback as IOperation).Redo();
                                    }
                                    SketchCommandFlow int01 = this;
                                    int01.int_0 = int01.int_0 + 1;
                                    break;
                                }

                                case "a":
                                {
                                    if (SketchToolAssist.Feedback is INewPolylineFeedback)
                                    {
                                        (SketchToolAssist.Feedback as INewPolylineFeedback).ChangeLineType(
                                            enumLineType.LTCircularArc);
                                    }
                                    if (SketchToolAssist.Feedback is INewPolygonFeedbackEx)
                                    {
                                        (SketchToolAssist.Feedback as INewPolygonFeedbackEx).ChangeLineType(
                                            enumLineType.LTCircularArc);
                                    }
                                    SketchCommandFlow sketchCommandFlow1 = this;
                                    sketchCommandFlow1.int_0 = sketchCommandFlow1.int_0 + 1;
                                    this.icommandFlow_0      = new ThreePointArcCommandFlow(this)
                                    {
                                        AppContext = this._appContext
                                    };
                                    break;
                                }

                                case "t":
                                {
                                    if (SketchToolAssist.Feedback is INewPolylineFeedback)
                                    {
                                        (SketchToolAssist.Feedback as INewPolylineFeedback).ChangeLineType(
                                            enumLineType.LTTangentCircularArc);
                                    }
                                    if (SketchToolAssist.Feedback is INewPolygonFeedbackEx)
                                    {
                                        (SketchToolAssist.Feedback as INewPolygonFeedbackEx).ChangeLineType(
                                            enumLineType.LTTangentCircularArc);
                                    }
                                    SketchCommandFlow int02 = this;
                                    int02.int_0         = int02.int_0 + 1;
                                    this.icommandFlow_0 = new ConstructTangentArcCommandFlow(this)
                                    {
                                        AppContext = this._appContext
                                    };
                                    break;
                                }

                                case "j":
                                {
                                    SketchCommandFlow sketchCommandFlow2 = this;
                                    sketchCommandFlow2.int_0 = sketchCommandFlow2.int_0 + 1;
                                    this.icommandFlow_0      = new GDCommandFlow()
                                    {
                                        AppContext = this._appContext
                                    };
                                    break;
                                }

                                case "g":
                                {
                                    SketchCommandFlow int03 = this;
                                    int03.int_0 = int03.int_0 + 1;
                                    int    pointCount = SketchToolAssist.m_pPointColn.PointCount;
                                    IPoint point      = SketchToolAssist.m_pPointColn.Point[pointCount - 2];
                                    IPoint point1     = SketchToolAssist.m_pPointColn.Point[pointCount - 1];
                                    IPoint point2     = SketchToolAssist.m_pPointColn.Point[0];
                                    pointClass = CommonHelper.GetGD(point, point1, point2);
                                    SketchShareEx.SketchMouseDown(pointClass,
                                                                  this._appContext.MapControl.Map as IActiveView,
                                                                  Editor.CurrentEditTemplate.FeatureLayer);
                                    this.method_0();
                                    break;
                                }

                                case "d":
                                {
                                    SketchCommandFlow sketchCommandFlow3 = this;
                                    sketchCommandFlow3.int_0 = sketchCommandFlow3.int_0 + 1;
                                    if (!(SketchToolAssist.Feedback is INewPolylineFeedback))
                                    {
                                        break;
                                    }
                                    pointClass =
                                        (SketchToolAssist.Feedback as INewPolylineFeedback).ReverseOrientation();
                                    if (pointClass == null)
                                    {
                                        break;
                                    }
                                    SketchShareEx.LastPoint = pointClass;
                                    break;
                                }

                                case "f":
                                {
                                    SketchShareEx.EndSketch(false, this._appContext.MapControl.Map as IActiveView,
                                                            Editor.CurrentEditTemplate.FeatureLayer);
                                    this.int_0 = 0;
                                    this._appContext.ShowCommandString("完成", CommandTipsType.CTTInput);
                                    this.Reset();
                                    Editor.EnableUndoRedo = true;
                                    flag = true;
                                    return(flag);
                                }

                                default:
                                {
                                    this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                                    this.string_1 = "";
                                    if (this.icommandFlow_0 != null)
                                    {
                                        this.icommandFlow_0.ShowCommandLine();
                                        flag = true;
                                        return(flag);
                                    }
                                    break;
                                }
                                }
                            }
                            else
                            {
                            }

                            this.string_1 = "";
                            if (this.icommandFlow_0 != null)
                            {
                                this.icommandFlow_0.ShowCommandLine();
                                flag = true;
                                return(flag);
                            }
                        }
                    }
                    else if (SketchToolAssist.Feedback == null)
                    {
                        flag = false;
                        return(flag);
                    }
                    else if (this._appContext != null)
                    {
                        SketchShareEx.EndSketch(false, this._appContext.MapControl.Map as IActiveView,
                                                Editor.CurrentEditTemplate.FeatureLayer);
                    }
                }
                catch
                {
                    this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                }
                this.ShowCommandLine();
                flag = true;
            }
            else
            {
                chrArray      = new char[] { ',' };
                strArrays     = string_2.Split(chrArray);
                this.string_1 = "";
                num           = 0;
                num1          = 0;
                num2          = 0;
                pointClass    = new ESRI.ArcGIS.Geometry.Point();
                try
                {
                    if ((int)strArrays.Length < 2)
                    {
                        this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                    }
                    else
                    {
                        num = Convert.ToDouble(strArrays[0]);
                        pointClass.PutCoords(num, Convert.ToDouble(strArrays[1]));
                        if ((int)strArrays.Length >= 3)
                        {
                            pointClass.Z = Convert.ToDouble(strArrays[2]);
                        }
                        SketchShareEx.SketchMouseDown(pointClass, this._appContext.MapControl.Map as IActiveView,
                                                      Editor.CurrentEditTemplate.FeatureLayer);
                        if ((Editor.CurrentEditTemplate.FeatureLayer.FeatureClass.ShapeType ==
                             esriGeometryType.esriGeometryPoint
                            ? false
                            : Editor.CurrentEditTemplate.FeatureLayer.FeatureClass.FeatureType !=
                             esriFeatureType.esriFTAnnotation))
                        {
                            SketchCommandFlow int04 = this;
                            int04.int_0 = int04.int_0 + 1;
                        }
                    }
                }
                catch
                {
                    this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                }
                this.ShowCommandLine();
                flag = true;
            }
            return(flag);
        }
Example #4
0
 static SketchShareEx()
 {
     SketchShareEx.old_acctor_mc();
 }
Example #5
0
        public static string SketchMouseMove(IPoint ipoint_0, IMap imap_0,
                                             IEngineSnapEnvironment iengineSnapEnvironment_0)
        {
            string str;
            string unit;

            if (imap_0 != null)
            {
                string str1 = "";
                SketchShareEx.m_pAnchorPoint = ipoint_0;
                SketchShareEx.Snap2Point(ipoint_0, SketchShareEx.m_pAnchorPoint, esriSimpleMarkerStyle.esriSMSDiamond,
                                         imap_0 as IActiveView, iengineSnapEnvironment_0);
                if (SketchToolAssist.Feedback != null)
                {
                    SketchToolAssist.Feedback.MoveTo(SketchShareEx.m_pAnchorPoint);
                }
                if (SketchToolAssist.CurrentTask != null)
                {
                    str = "";
                }
                else if (SketchShareEx.m_bInUse)
                {
                    SketchShareEx.m_pPoint = new Point()
                    {
                        X = ipoint_0.X,
                        Y = ipoint_0.Y
                    };
                    if (SketchShareEx.m_bShowVlaue)
                    {
                        if (SketchToolAssist.Feedback is INewLineFeedback)
                        {
                            unit = CommonHelper.GetUnit(imap_0.MapUnits);
                            double num = CommonHelper.measureLength(ipoint_0, 2, ref SketchShareEx.m_pLastPoint1,
                                                                    ref SketchShareEx.m_pEndPoint1, ref SketchShareEx.m_totalLength);
                            string[] strArrays = new string[]
                            {
                                "距离 = ", num.ToString("0.###"), unit, ", 总长度 = ",
                                SketchShareEx.m_totalLength.ToString("0.###"), unit
                            };
                            str1 = string.Concat(strArrays);
                        }
                        else if (SketchToolAssist.Feedback is INewPolygonFeedback)
                        {
                            unit = CommonHelper.GetUnit(imap_0.MapUnits);
                            double num1 = CommonHelper.measureArea(ipoint_0, 2, ref SketchToolAssist.m_pPointColn);
                            try
                            {
                                double length = (SketchToolAssist.m_pPointColn as IPolygon).Length;
                                if (num1 > 0)
                                {
                                    str1 = string.Format("周长 = {0:0.###} {1} ,总面积 = {2:0.###} 平方{1}", length, unit, num1);
                                }
                            }
                            catch
                            {
                            }
                        }
                    }
                    str = str1;
                }
                else
                {
                    str = "";
                }
            }
            else
            {
                str = "";
            }
            return(str);
        }
Example #6
0
        public bool HandleCommand(string string_1)
        {
            bool flag;

            if (!this.bool_0)
            {
                try
                {
                    string_1 = string_1.Trim();
                    if (string_1.Length != 0)
                    {
                        string[] strArrays  = string_1.Split(new char[] { ',' });
                        double   num        = 0;
                        double   num1       = 0;
                        IPoint   pointClass = new ESRI.ArcGIS.Geometry.Point();
                        if ((int)strArrays.Length < 2)
                        {
                            this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                            flag = true;
                            return(flag);
                        }
                        else
                        {
                            num = Convert.ToDouble(strArrays[0]);
                            pointClass.PutCoords(num, Convert.ToDouble(strArrays[1]));
                            if ((int)strArrays.Length == 3)
                            {
                                num1         = Convert.ToDouble(strArrays[2]);
                                pointClass.Z = num1;
                            }
                            this.int_0  = 1;
                            this.bool_0 = true;
                            if (SketchShareEx.LastPoint != null)
                            {
                                int    pointCount = SketchToolAssist.m_pPointColn.PointCount;
                                IPoint point      = SketchToolAssist.m_pPointColn.Point[pointCount - 2];
                                IPoint point1     = SketchToolAssist.m_pPointColn.Point[pointCount - 1];
                                IPoint gD         = CommonHelper.GetGD(point, point1, pointClass);
                                gD.Z = num1;
                                SketchShareEx.SketchMouseDown(gD, this._appContext.MapControl.Map as IActiveView,
                                                              Editor.CurrentEditTemplate.FeatureLayer);
                            }
                            SketchShareEx.SketchMouseDown(pointClass, this._appContext.MapControl.Map as IActiveView,
                                                          Editor.CurrentEditTemplate.FeatureLayer);
                        }
                    }
                    else
                    {
                        flag = false;
                        return(flag);
                    }
                }
                catch
                {
                    this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                    flag = true;
                    return(flag);
                }
                if (this.icommandFlow_0 == null)
                {
                    this.ShowCommandLine();
                }
                else
                {
                    this.icommandFlow_0.ShowCommandLine();
                }
                flag = true;
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
Example #7
0
 public bool HandleCommand(string string_1)
 {
     bool flag;
     if (!this.bool_0)
     {
         try
         {
             string_1 = string_1.Trim();
             if (string_1.Length != 0)
             {
                 string[] strArrays = string_1.Split(new char[] {','});
                 double num = 0;
                 double num1 = 0;
                 double num2 = 0;
                 IPoint pointClass = new ESRI.ArcGIS.Geometry.Point();
                 if ((int) strArrays.Length < 2)
                 {
                     this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
                     flag = true;
                     return flag;
                 }
                 else
                 {
                     num = Convert.ToDouble(strArrays[0]);
                     num1 = Convert.ToDouble(strArrays[1]);
                     pointClass.PutCoords(num, num1);
                     if ((int) strArrays.Length == 3)
                     {
                         num2 = Convert.ToDouble(strArrays[2]);
                         pointClass.Z = num2;
                     }
                     this.int_0 = 1;
                     this.bool_0 = true;
                     SketchShareEx.SketchMouseDown(pointClass, this._appContext.MapControl.Map as IActiveView,
                         Editor.CurrentEditTemplate.FeatureLayer);
                     if (SketchShareEx.StartPoint != null)
                     {
                         IPoint point = new ESRI.ArcGIS.Geometry.Point();
                         point.PutCoords(SketchShareEx.StartPoint.X, num1);
                         point.Z = num2;
                         SketchShareEx.SketchMouseDown(point, this._appContext.MapControl.Map as IActiveView,
                             Editor.CurrentEditTemplate.FeatureLayer);
                         SketchShareEx.SketchMouseDown(SketchShareEx.StartPoint,
                             this._appContext.MapControl.Map as IActiveView,
                             Editor.CurrentEditTemplate.FeatureLayer);
                     }
                 }
             }
             else
             {
                 flag = false;
                 return flag;
             }
         }
         catch
         {
             this._appContext.ShowCommandString("输入不正确", CommandTipsType.CTTLog);
             flag = true;
             return flag;
         }
         if (this.icommandFlow_0 == null)
         {
             this.ShowCommandLine();
         }
         else
         {
             this.icommandFlow_0.ShowCommandLine();
         }
         flag = true;
     }
     else
     {
         flag = false;
     }
     return flag;
 }