public override bool SplitAtPoint(IPoint ipoint_0, out IGeometryBag igeometryBag_0) { bool flag; bool flag1; int num; int num1; int i; igeometryBag_0 = null; IPolycurve mPGeometry = this.m_pGeometry as IPolycurve; if (mPGeometry != null) { mPGeometry.SplitAtPoint(ipoint_0, true, true, out flag1, out num, out num1); if (flag1) { igeometryBag_0 = new GeometryBag() as IGeometryBag; IGeometryCollection geometryCollection = mPGeometry as IGeometryCollection; IGeometryCollection polylineClass = new Polyline() as IGeometryCollection; object value = Missing.Value; for (i = 0; i < num; i++) { polylineClass.AddGeometry(geometryCollection.Geometry[i], ref value, ref value); } (igeometryBag_0 as IGeometryCollection).AddGeometry(polylineClass as IGeometry, ref value, ref value); polylineClass = new Polyline() as IGeometryCollection; for (i = num; i < geometryCollection.GeometryCount; i++) { polylineClass.AddGeometry(geometryCollection.Geometry[i], ref value, ref value); } (igeometryBag_0 as IGeometryCollection).AddGeometry(polylineClass as IGeometry, ref value, ref value); flag = true; } else { flag = false; } } else { flag = false; } return(flag); }
private static IList PointSplitLine(IPolycurve pPolycurve, IPoint pt) { int num; int num2; bool flag; IList list = new ArrayList(); pPolycurve.SplitAtPoint(pt, true, true, out flag, out num2, out num); if (flag) { object before = Missing.Value; try { int num3; IGeometryCollection geometrys = new PolylineClass(); for (num3 = 0; num3 < num2; num3++) { geometrys.AddGeometry((pPolycurve as IGeometryCollection).get_Geometry(num3), ref before, ref before); } if ((geometrys as IPointCollection).PointCount > 1) { list.Add(geometrys); } geometrys = new PolylineClass(); for (num3 = num2; num3 < (pPolycurve as IGeometryCollection).GeometryCount; num3++) { geometrys.AddGeometry((pPolycurve as IGeometryCollection).get_Geometry(num3), ref before, ref before); } if ((geometrys as IPointCollection).PointCount > 1) { list.Add(geometrys); } } catch (Exception exception) { CErrorLog.writeErrorLog(null, exception, ""); } } return(list); }
public override bool SplitAtPoint(IPoint ipoint_0, out IGeometryBag igeometryBag_0) { bool flag; bool flag1; int num; int num1; igeometryBag_0 = null; IPolycurve mPGeometry = this.m_pGeometry as IPolycurve; if (mPGeometry != null) { mPGeometry.SplitAtPoint(ipoint_0, true, true, out flag1, out num, out num1); object value = Missing.Value; igeometryBag_0 = new GeometryBag() as IGeometryBag; (igeometryBag_0 as IGeometryCollection).AddGeometry(mPGeometry, ref value, ref value); flag = true; } else { flag = false; } return(flag); }