private static void AddSelectedFeaturesToEditingLayer(FeatureLayer sourceLayer)
        {
            GisEditorEditInteractiveOverlay overlay = GisEditor.ActiveMap.FeatureLayerEditOverlay;

            if (overlay != null)
            {
                FeatureLayer         editingLayer = overlay.EditTargetLayer;
                Collection <Feature> features     = GisEditor.SelectionManager.GetSelectedFeatures(sourceLayer);
                foreach (var feature in features)
                {
                    feature.Id = Guid.NewGuid().ToString();
                    overlay.NewFeatureIds.Add(feature.Id);
                    overlay.EditShapesLayer.InternalFeatures.Add(feature);
                }
                sourceLayer.SafeProcess(() =>
                {
                    Collection <FeatureSourceColumn> columns = sourceLayer.FeatureSource.GetColumns();
                    overlay.EditShapesLayer.Columns.Clear();
                    foreach (var column in columns)
                    {
                        overlay.EditShapesLayer.Columns.Add(column);
                    }
                });

                overlay.TakeSnapshot();
                overlay.Refresh();
                GisEditor.SelectionManager.ClearSelectedFeatures(sourceLayer);
            }
        }
        private static void AddFeaturesToEditingLayer(IEnumerable <Feature> features)
        {
            GisEditorEditInteractiveOverlay editOverlay = GisEditor.ActiveMap.FeatureLayerEditOverlay;

            if (editOverlay != null)
            {
                FeatureLayer editingLayer = editOverlay.EditTargetLayer;

                foreach (var feature in features)
                {
                    feature.Id = Guid.NewGuid().ToString();
                    editOverlay.NewFeatureIds.Add(feature.Id);
                    editOverlay.EditShapesLayer.InternalFeatures.Add(feature);
                }
                editOverlay.TakeSnapshot();
                editOverlay.Refresh();
            }
        }
        private void RemoveMenuItem_Click(object sender, RoutedEventArgs e)
        {
            GisEditorEditInteractiveOverlay editOverlay = GisEditor.ActiveMap.FeatureLayerEditOverlay;

            if (editOverlay != null && selectedFeature.GetShape() != null)
            {
                lock (editOverlay.EditShapesLayer)
                {
                    if (!editOverlay.EditShapesLayer.IsOpen)
                    {
                        editOverlay.EditShapesLayer.Open();
                    }
                    editOverlay.EditShapesLayer.EditTools.BeginTransaction();
                    editOverlay.EditShapesLayer.EditTools.Delete(selectedFeature.Id);
                    editOverlay.EditShapesLayer.EditTools.CommitTransaction();
                }

                editOverlay.ClearVertexControlPoints();
                editOverlay.TakeSnapshot();
                editOverlay.Refresh();
            }
        }