Exemple #1
0
 private static void old_acctor_mc()
 {
     SketchShareEx.m_psnaper            = new PointSnapper();
     SketchShareEx.m_CurrentStep        = 0;
     SketchShareEx.m_SysGrants          = new SysGrants(AppConfigInfo.UserID);
     SketchShareEx.m_pSketchCommandFolw = new SketchCommandFlow();
     SketchShareEx.IsFixLength          = false;
     SketchShareEx.IsFixDirection       = false;
     SketchShareEx.FixLength            = 0;
     SketchShareEx.FixDirection         = 0;
     SketchShareEx.StartPoint           = null;
     SketchShareEx.LastPoint            = null;
     SketchShareEx.IsCreateParrel       = false;
     SketchShareEx.m_offset             = 1;
     SketchShareEx.ConstructOffset      = 5;
     SketchShareEx.PointCount           = 0;
     SketchShareEx.m_pAnchorPoint       = null;
     SketchShareEx.m_bInUse             = false;
     SketchShareEx.m_pPointCollection   = null;
     SketchShareEx.m_pLastPoint1        = null;
     SketchShareEx.m_pEndPoint1         = null;
     SketchShareEx.m_bShowVlaue         = true;
     SketchShareEx.m_totalLength        = 0;
     SketchShareEx.m_bSnapSuccessful    = false;
     SketchShareEx.m_pSym             = new SimpleMarkerSymbol();
     SketchShareEx.m_pPoint           = null;
     SketchShareEx.m_HasLicense       = false;
     SketchShareEx.m_LastPartGeometry = null;
     SketchShareEx.m_bInStreaming     = false;
     SketchShareEx.m_MinDis           = 0;
     SketchShareEx.m_HasLicense       = EditorLicenseProviderCheck.Check();
     SketchShareEx.m_pSym.Style       = esriSimpleMarkerStyle.esriSMSCircle;
     SketchShareEx.m_pSym.Size        = 8;
     SketchShareEx.m_pSym.Outline     = true;
     SketchShareEx.m_pSym.Color       = ColorManage.GetRGBColor(0, 255, 255);
 }
Exemple #2
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);
        }