Beispiel #1
0
        private static bool Store(
            EditOperation.IEditContext editContext,
            IDictionary <Feature, Geometry> result)
        {
            foreach (KeyValuePair <Feature, Geometry> keyValuePair in result)
            {
                Feature  feature  = keyValuePair.Key;
                Geometry geometry = keyValuePair.Value;

                if (geometry.IsEmpty)
                {
                    throw new Exception("One or more result geometries have become empty.");
                }

                feature.SetShape(geometry);
                feature.Store();

                editContext.Invalidate(feature);

                feature.Dispose();
            }

            _msg.InfoFormat("Successfully stored {0} updated features.", result.Count);

            return(true);
        }
        private static void StoreShape(Feature feature,
                                       Geometry geometry,
                                       EditOperation.IEditContext editContext)
        {
            if (geometry.IsEmpty)
            {
                throw new Exception("One or more updates geometries have become empty.");
            }

            feature.SetShape(geometry);
            feature.Store();

            editContext.Invalidate(feature);
        }