当前位置: 首页>>代码示例>>C#>>正文


C# IEditor.AbortOperation方法代码示例

本文整理汇总了C#中IEditor.AbortOperation方法的典型用法代码示例。如果您正苦于以下问题:C# IEditor.AbortOperation方法的具体用法?C# IEditor.AbortOperation怎么用?C# IEditor.AbortOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEditor的用法示例。


在下文中一共展示了IEditor.AbortOperation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AbortEdits

 private void AbortEdits(bool bUseNonVersionedDelete, IEditor pEd, IWorkspace pWS)
 {
     clsFabricUtils FabricUTILS = new clsFabricUtils();
       if (bUseNonVersionedDelete)
     FabricUTILS.AbortEditing(pWS);
       else
       {
     if (pEd != null)
     {
       if (pEd.EditState == esriEditState.esriStateEditing)
     pEd.AbortOperation();
     }
       }
 }
开发者ID:Esri,项目名称:parcel-fabric-desktop-addins,代码行数:14,代码来源:clsDeleteSelectedLinePts.cs

示例2: CreateSingle

        private static bool CreateSingle(ref IApplication app, ref  IEditor editor, IFeature pointFeature, IFeatureLayer matchLineFLayer,
                                                  IFeatureLayer targetLineFLayer, IEditTemplate targetLineEditTemplate,
                                                  List<pointAlongSettings> pointAlongLayers,
                                                  bool startAtMain, bool deleteExistingLines, FromToField[] fromToPairs, double doglegDistance,
                                                  bool DistAsPercent, double tolerenceForDelete, bool store, bool SearchOnLayer, int searchDistance, double angle, bool checkSelection)
        {
            IFeature lineFeature = null;
            IPoint thisPoint = null;
            IPoint turnPoint = null;
            IPoint toPoint = null;
            ICurve mainCurve = null;
            IPolyline polyline = null;
            IFeature pFeat = null;
            try
            {
                // Get closest main to point1

                thisPoint = (IPoint)pointFeature.ShapeCopy;

                lineFeature = Globals.GetClosestFeature(thisPoint, matchLineFLayer, Convert.ToDouble(searchDistance), SearchOnLayer, checkSelection);
                //    (_app.Document as IMxDocument).FocusMap.ClearSelection();

                if (lineFeature != null)
                {
                    //Delete any existing lateral lines at this location
                    if (deleteExistingLines)
                    {
                        DeleteExistingFeatures(pointFeature, targetLineFLayer, pointAlongLayers, tolerenceForDelete);
                    }

                    //Determine To and Turn Points
                    mainCurve = lineFeature.ShapeCopy as ICurve;
                    CreateToAndTurnPoints(mainCurve, thisPoint, out toPoint, out turnPoint, doglegDistance, DistAsPercent);

                    //Create the new line
                    polyline = Globals.CreatePolylineFromPointsNewTurn(thisPoint, turnPoint, toPoint, ref matchLineFLayer, ref lineFeature, SearchOnLayer, angle, editor.Map.SpatialReference);
                    //If requested, store pipe id in the point
                    StorePipeInfoPointFeature(lineFeature, pointFeature, fromToPairs, store);

                    if (polyline.Length > 0)
                    {
                        if (startAtMain)
                            polyline.ReverseOrientation();

                        if (targetLineEditTemplate != null)
                        {
                            pFeat = Globals.CreateFeature(polyline as IGeometry, targetLineEditTemplate, editor, app, false, false, true);
                        }
                        else
                        {
                            pFeat = Globals.CreateFeature(polyline as IGeometry, targetLineFLayer, editor, app, false, false, true);
                        }
                        if (pFeat == null)
                        {
                            editor.AbortOperation();
                            return false;

                        }
                        //Globals.SetFlowDirection(pFeat, targetLineFLayer);
                        try
                        {
                            if (pFeat != null)
                            {
                                Globals.ValidateFeature(pFeat);
                                pFeat.Store();
                            }
                            //if (pFeat is INetworkFeature)
                            //{
                            //    INetworkFeature pNF = (INetworkFeature)pFeat;

                            //    pNF.Connect();
                            //}
                        }
                        catch (Exception ex)
                        {
                            // MessageBox.Show("The Feature could not be stored, this is typically because the layer has Z and the geometric network was not created to honors, you need to drop the network and recreate it with Z's enabled\n" + ex.Message);
                        }

                        //Old Way
                        //IFeature pFeat = CreateLineFeature(targetLineFLayer, newPolyLine, targetLineValue, targetLineFieldName, targetLineSubtype);

                        //Optionally, create new point along line
                        // int idx = 0;
                        if (pointAlongLayers != null)
                        {
                            foreach (pointAlongSettings pPointAlongLayer in pointAlongLayers)
                            {
                                if (pPointAlongLayer.PolygonIntersectLayer != null)
                                    Globals.AddPointAlongLineWithIntersect(ref app, ref editor, polyline as ICurve, pPointAlongLayer.PointAlongLayer, pPointAlongLayer.PointAlongDistance, pPointAlongLayer.DistanceIsPercent, pPointAlongLayer.PointAlongEditTemplate, pPointAlongLayer.PolygonIntersectLayer, pPointAlongLayer.PolygonIntersectSide);

                                else
                                    Globals.AddPointAlongLine(ref app, ref editor, polyline as ICurve, pPointAlongLayer.PointAlongLayer, pPointAlongLayer.PointAlongDistance, pPointAlongLayer.DistanceIsPercent, pPointAlongLayer.PointAlongEditTemplate);
                                //   idx++;
                            }
                        }

                        //Globals.SetFlowDirection(pFeat, targetLineFLayer,((IMxDocument)app.Document).FocusMap);
                        //try
                        //{
                        //    if (pFeat != null)
//.........这里部分代码省略.........
开发者ID:tuyndv,项目名称:local-government-desktop-addins,代码行数:101,代码来源:ConstructionTools.cs


注:本文中的IEditor.AbortOperation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。