本文整理汇总了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();
}
}
}
示例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)
//.........这里部分代码省略.........