Example #1
0
        private static void SplitInOperation(IFeature polylineFeature,
                                             IPoint splitPoint,
                                             IEditOperationObserver observer)
        {
            observer.StartedOperation();

            var originalLine = (IPolyline)polylineFeature.ShapeCopy;

            IPolyline shorterGeometry;
            IPolyline longerGeometry;

            Assert.True(GeometryUtils.TrySplitPolyline(
                            originalLine, splitPoint, true, out shorterGeometry,
                            out longerGeometry));

            const bool exceptShape = true;
            IFeature   newFeature  = GdbObjectUtils.DuplicateFeature(polylineFeature, exceptShape);

            GdbObjectUtils.SetFeatureShape(newFeature, shorterGeometry);
            GdbObjectUtils.SetFeatureShape(polylineFeature, longerGeometry);

            newFeature.Store();
            polylineFeature.Store();

            observer.Updating(polylineFeature);
            observer.Creating(newFeature);

            observer.IsCompletingOperation = true;
            observer.CompletingOperation();
            observer.IsCompletingOperation = false;
        }
Example #2
0
        private static IFeature UpdateInOperation(Func <IFeature> updateFeatureProc,
                                                  IEditOperationObserver observer)
        {
            observer.StartedOperation();

            IFeature updatedFeature = updateFeatureProc();

            observer.Updating(updatedFeature);

            observer.IsCompletingOperation = true;
            observer.CompletingOperation();
            observer.IsCompletingOperation = false;

            return(updatedFeature);
        }
Example #3
0
        private static void MergeInOperation(IFeature update,
                                             IFeature delete,
                                             IEditOperationObserver observer)
        {
            observer.StartedOperation();

            IGeometry resultGeometry = GeometryUtils.Union(update.Shape, delete.Shape);

            GdbObjectUtils.SetFeatureShape(update, resultGeometry);
            observer.Updating(update);

            delete.Delete();
            observer.Deleting(delete);

            observer.IsCompletingOperation = true;
            observer.CompletingOperation();
            observer.IsCompletingOperation = false;
        }