Index: Core/Common/src/Core.Common.Controls.Swf/DataEditorGenerator/DataEditor.cs =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Controls.Swf/DataEditorGenerator/DataEditor.cs (.../DataEditor.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Core/Common/src/Core.Common.Controls.Swf/DataEditorGenerator/DataEditor.cs (.../DataEditor.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -6,7 +6,6 @@ using Core.Common.Controls.Swf.DataEditorGenerator.Binding; using Core.Common.Controls.Swf.DataEditorGenerator.Binding.ControlBindings; using Core.Common.Utils.Collections; -using IEditableObject = Core.Common.Utils.Editing.IEditableObject; namespace Core.Common.Controls.Swf.DataEditorGenerator { @@ -85,12 +84,6 @@ private void DataPropertyChanged(object sender, PropertyChangedEventArgs e) { - var dataAsEditableObject = data as IEditableObject; - if (dataAsEditableObject != null && dataAsEditableObject.IsEditing) - { - return; // still editing, skip - } - foreach (var binding in Bindings) { binding.OnPropertyChanged(sender, e); Index: Core/Common/src/Core.Common.Controls.Swf/Table/TableView.cs =================================================================== diff -u -rbbc410887bcfea1fc93f1c2eb4a2a5126bf632ce -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Controls.Swf/Table/TableView.cs (.../TableView.cs) (revision bbc410887bcfea1fc93f1c2eb4a2a5126bf632ce) +++ Core/Common/src/Core.Common.Controls.Swf/Table/TableView.cs (.../TableView.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -16,7 +16,6 @@ using Core.Common.Utils.Aop; using Core.Common.Utils.Collections; using Core.Common.Utils.Collections.Generic; -using Core.Common.Utils.Editing; using Core.Common.Utils.Globalization; using Core.Common.Utils.Reflection; using DevExpress.Data; @@ -33,7 +32,6 @@ using DevExpress.XtraGrid.Views.Grid; using DevExpress.XtraGrid.Views.Grid.ViewInfo; using log4net; -using IEditableObject = Core.Common.Utils.Editing.IEditableObject; using TypeConverter = Core.Common.Utils.TypeConverter; namespace Core.Common.Controls.Swf.Table @@ -52,11 +50,9 @@ } private static readonly ILog Log = LogManager.GetLogger(typeof(TableView)); - private readonly EventedList selectedCells; private readonly TableViewValidator tableViewValidator; private readonly EventedList columns; - private bool isPasting; private bool isSelectionChanging; private bool updatingSelection; @@ -65,7 +61,6 @@ private bool refreshRequired; private bool allowColumnSorting = true; private bool f2Pressed; - private Timer refreshTimer; private BindingSource bindingSource; private GridCell[] cellsToFill; @@ -1346,10 +1341,6 @@ public bool IsEndEditOnEnterKey { get; set; } - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public IEditableObject EditableObject { get; set; } - /// /// Enable filtering for all columns /// @@ -1783,29 +1774,26 @@ return; } - DoActionInEditAction(this, "Deleting selection", () => + //delete rows in case entire rows are selected + var groupBy = SelectedCells.GroupBy(c => c.RowIndex); + var count = Columns.Count(c => c.Visible); + if (AllowDeleteRow && (RowSelect || groupBy.All(g => g.Count() == count))) { - //delete rows in case entire rows are selected - var groupBy = SelectedCells.GroupBy(c => c.RowIndex); - var count = Columns.Count(c => c.Visible); - if (AllowDeleteRow && (RowSelect || groupBy.All(g => g.Count() == count))) + if (RowDeleteHandler == null || !RowDeleteHandler()) { - if (RowDeleteHandler == null || !RowDeleteHandler()) - { - dxGridView.DeleteSelectedRows(); - } - return; + dxGridView.DeleteSelectedRows(); } + return; + } - var selectedGridCells = SelectedCells.ToList(); - foreach (var c in selectedGridCells) - { - var defaultValue = c.Column.DefaultValue ?? - TypeUtils.GetDefaultValue(c.Column.ColumnType); + var selectedGridCells = SelectedCells.ToList(); + foreach (var c in selectedGridCells) + { + var defaultValue = c.Column.DefaultValue ?? + TypeUtils.GetDefaultValue(c.Column.ColumnType); - SetCellValue(c.RowIndex, c.Column.DisplayIndex, Convert.ToString(defaultValue)); - } - }); + SetCellValue(c.RowIndex, c.Column.DisplayIndex, Convert.ToString(defaultValue)); + } } public void AddColumn(string dataSourcePropertyName, string columnCaption, bool readOnly = false, int width = 100, Type columnType = null, string displayFormat = null) @@ -1910,27 +1898,6 @@ return Columns.Any(c => c.SortOrder != SortOrder.None); } - internal static void DoActionInEditAction(ITableView tableView, string actionName, Action action) - { - var editableObject = tableView.EditableObject ?? tableView.Data as IEditableObject; - if (editableObject != null) - { - editableObject.BeginEdit(new DefaultEditAction(actionName)); - } - - try - { - action(); - } - finally - { - if (editableObject != null) - { - editableObject.EndEdit(); - } - } - } - internal TableViewCell GetFocusedCell() { //no selection @@ -2347,12 +2314,6 @@ if (gridcell.Column.ColumnType == e.Value.GetType()) { dxGridView.SetRowCellValue(gridcell.RowHandle, gridcell.Column, e.Value); - - var editableRowObject = dxGridView.GetRow(gridcell.RowHandle) as System.ComponentModel.IEditableObject; - if (editableRowObject != null) - { - editableRowObject.EndEdit(); // Can throw exception, validation for example - } } } } Index: Core/Common/src/Core.Common.Controls.Swf/Table/TableViewPasteController.cs =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Controls.Swf/Table/TableViewPasteController.cs (.../TableViewPasteController.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Core/Common/src/Core.Common.Controls.Swf/Table/TableViewPasteController.cs (.../TableViewPasteController.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -254,7 +254,7 @@ { if (wrapInEditAction) { - TableView.DoActionInEditAction(TableView, "Pasting values", () => PasteValuesCore(clipboardLines, targetSelection, allowNewRows)); + PasteValuesCore(clipboardLines, targetSelection, allowNewRows); } else { Index: Core/Common/src/Core.Common.Controls/ITableView.cs =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Controls/ITableView.cs (.../ITableView.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Core/Common/src/Core.Common.Controls/ITableView.cs (.../ITableView.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using IEditableObject = Core.Common.Utils.Editing.IEditableObject; namespace Core.Common.Controls { @@ -135,11 +134,6 @@ bool IsEndEditOnEnterKey { get; set; } /// - /// If data is not editable object it's owner is, this should be set to it. - /// - IEditableObject EditableObject { get; set; } - - /// /// Allows to fit all columns to their contents. /// void BestFitColumns(bool useOnlyFirstWordOfHeader = true); Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Aop/EditActionAttribute.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/src/Core.Common.Utils/Aop/EntityAttribute.cs =================================================================== diff -u -r53e3425d6199f9277196c5178fea71f8329b084c -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Utils/Aop/EntityAttribute.cs (.../EntityAttribute.cs) (revision 53e3425d6199f9277196c5178fea71f8329b084c) +++ Core/Common/src/Core.Common.Utils/Aop/EntityAttribute.cs (.../EntityAttribute.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -213,7 +213,6 @@ if (fireEvents) { - EditActionAttribute.FireBeforeEventCall(instance, true); OnEntityEventMethod(instance, new PropertyChangingEventArgs(locationName), EntityEventType.PropertyChanging); } @@ -226,15 +225,8 @@ { if (fireEvents) { - try - { - OnEntityEventMethod(instance, new PropertyChangedEventArgs(locationName), - EntityEventType.PropertyChanged); - } - finally - { - EditActionAttribute.FireAfterEventCall(instance, true, false); - } + OnEntityEventMethod(instance, new PropertyChangedEventArgs(locationName), + EntityEventType.PropertyChanged); } } } Index: Core/Common/src/Core.Common.Utils/Collections/Generic/EventedList.cs =================================================================== diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Utils/Collections/Generic/EventedList.cs (.../EventedList.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b) +++ Core/Common/src/Core.Common.Utils/Collections/Generic/EventedList.cs (.../EventedList.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -18,11 +18,9 @@ { public event NotifyCollectionChangingEventHandler CollectionChanging; public event NotifyCollectionChangedEventHandler CollectionChanged; - public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; private static readonly ILog eventsLog = LogManager.GetLogger("Events"); - // WARNING: any change here should be mirrored in >>>>>>>>> PersistentEventedList <<<<<<<<<< !!!!!!! // TODO: make PersistentEventedList and EventedList use the same impl // TODO: make it work on Ranges and send events on ranges @@ -37,8 +35,8 @@ private PropertyChangedEventHandler Item_PropertyChangedDelegate; private NotifyCollectionChangingEventHandler Item_CollectionChangingDelegate; private NotifyCollectionChangedEventHandler Item_CollectionChangedDelegate; - private bool skipChildItemEventBubbling; + public bool HasParent { get; set; } bool INotifyCollectionChange.SkipChildItemEventBubbling { @@ -72,8 +70,6 @@ } } - public bool HasParent { get; set; } - #region Constructors /// @@ -420,8 +416,6 @@ private bool FireCollectionChangingEvent(NotifyCollectionChangeAction action, T item, int index) { - EditActionAttribute.FireBeforeEventCall(this, false); - if (CollectionChanging != null) { if (EventSettings.EnableLogging) @@ -437,15 +431,9 @@ } catch { - EditActionAttribute.FireAfterEventCall(this, false, args.Cancel); throw; } - if (args.Cancel) - { - EditActionAttribute.FireAfterEventCall(this, false, args.Cancel); - } - return !args.Cancel; } @@ -454,26 +442,19 @@ private void FireCollectionChangedEvent(NotifyCollectionChangeAction action, object item, int index, object oldItem = null) { - try + if (CollectionChanged != null) { - if (CollectionChanged != null) + if (EventSettings.EnableLogging) { - if (EventSettings.EnableLogging) - { - eventsLog.DebugFormat("CollectionChanged L<< '{0}[{1}]', item:{2}, index:{3}, action:{4} - END <<<<<<<<<<<<<<", "EventedList", typeof(T).Name, item, index, action); - } - - var args = new NotifyCollectionChangingEventArgs(action, item, index, -1) - { - OldItem = oldItem - }; - CollectionChanged(this, args); + eventsLog.DebugFormat("CollectionChanged L<< '{0}[{1}]', item:{2}, index:{3}, action:{4} - END <<<<<<<<<<<<<<", "EventedList", typeof(T).Name, item, index, action); } + + var args = new NotifyCollectionChangingEventArgs(action, item, index, -1) + { + OldItem = oldItem + }; + CollectionChanged(this, args); } - finally - { - EditActionAttribute.FireAfterEventCall(this, false, false); - } } private void Item_CollectionChanging(object sender, NotifyCollectionChangingEventArgs e) Index: Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj =================================================================== diff -u -r293be5aa0c9cfb58fea075f0ce6943fdfb310406 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 293be5aa0c9cfb58fea075f0ce6943fdfb310406) +++ Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -105,7 +105,6 @@ Properties\GlobalAssembly.cs - @@ -120,11 +119,7 @@ - - - - @@ -150,7 +145,6 @@ - Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Editing/DefaultEditAction.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Editing/EditActionBase.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Editing/EditableObjectExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Editing/IEditAction.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Utils/Editing/IEditableObject.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/test/Core.Common.Base.Tests/Controls/Swf/TestClasses/Child.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Base.Tests/Controls/Swf/TestClasses/Child.cs (revision 0) +++ Core/Common/test/Core.Common.Base.Tests/Controls/Swf/TestClasses/Child.cs (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -0,0 +1,17 @@ +using Core.Common.Utils.Aop; + +namespace Core.Common.Base.Tests.Controls.Swf.UndoRedoTestClasses +{ + [Entity(FireOnCollectionChange = false)] + public class Child + { + private string Name { get; set; } + + public override string ToString() + { + return Name; + } + + + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Base.Tests/Controls/Swf/TestClasses/Parent.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Base.Tests/Controls/Swf/TestClasses/Parent.cs (revision 0) +++ Core/Common/test/Core.Common.Base.Tests/Controls/Swf/TestClasses/Parent.cs (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -0,0 +1,18 @@ +using Core.Common.Utils.Aop; +using Core.Common.Utils.Collections.Generic; + +namespace Core.Common.Base.Tests.Controls.Swf.UndoRedoTestClasses +{ + [Entity] + public class Parent + { + public Parent() + { + Children = new EventedList(); + } + + public IEventedList Children { get; set; } + + public string Name { get; set; } + } +} \ No newline at end of file Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Base.Tests/Controls/Swf/UndoRedoTestClasses/Child.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 22469012664426d8196f8cd350cde57a8a50bc70 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Base.Tests/Controls/Swf/UndoRedoTestClasses/Parent.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/test/Core.Common.Base.Tests/Core.Common.Base.Tests.csproj =================================================================== diff -u -r293be5aa0c9cfb58fea075f0ce6943fdfb310406 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/Common/test/Core.Common.Base.Tests/Core.Common.Base.Tests.csproj (.../Core.Common.Base.Tests.csproj) (revision 293be5aa0c9cfb58fea075f0ce6943fdfb310406) +++ Core/Common/test/Core.Common.Base.Tests/Core.Common.Base.Tests.csproj (.../Core.Common.Base.Tests.csproj) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -120,8 +120,8 @@ - - + + True True Index: Core/GIS/src/Core.GIS.SharpMap.Api/Editors/IFeatureInteractor.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap.Api/Editors/IFeatureInteractor.cs (.../IFeatureInteractor.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/src/Core.GIS.SharpMap.Api/Editors/IFeatureInteractor.cs (.../IFeatureInteractor.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.SharpMap.Api.Delegates; @@ -49,11 +48,6 @@ IList Trackers { get; } /// - /// TODO: YAGNI, do it using feature, somewhere else - /// - IEditableObject EditableObject { get; set; } - - /// /// Moves selected trackers. is leading and will be used as source for /// falloff policy. /// Index: Core/GIS/src/Core.GIS.SharpMap.UI/Tools/CurvePointTool.cs =================================================================== diff -u -ree0b95b2a1a34d8e81a21c8d05ef1354169af50c -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap.UI/Tools/CurvePointTool.cs (.../CurvePointTool.cs) (revision ee0b95b2a1a34d8e81a21c8d05ef1354169af50c) +++ Core/GIS/src/Core.GIS.SharpMap.UI/Tools/CurvePointTool.cs (.../CurvePointTool.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; -using Core.Common.Utils; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.SharpMap.Api.Editors; @@ -157,24 +155,13 @@ { featureInteractor.Start(); - if (featureInteractor.EditableObject != null) - { - var featureName = featureInteractor.SourceFeature.Name; - featureInteractor.EditableObject.BeginEdit(string.Format(ActionName + " {0}", featureName)); - } - renderRequired = Mode == EditMode.Add ? featureInteractor.InsertTracker(worldPos, SnapResult.SnapIndexPrevious + 1) : featureInteractor.RemoveTracker(trackerFeature); featureInteractor.Stop(); } - if (featureInteractor.EditableObject != null) - { - featureInteractor.EditableObject.EndEdit(); - } - SelectTool.Select(featureInteractor.Layer, featureInteractor.SourceFeature); if (renderRequired) Index: Core/GIS/src/Core.GIS.SharpMap.UI/Tools/DeleteTool.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap.UI/Tools/DeleteTool.cs (.../DeleteTool.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/src/Core.GIS.SharpMap.UI/Tools/DeleteTool.cs (.../DeleteTool.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.SharpMap.Api.Layers; @@ -39,16 +38,10 @@ } var featuresDeleted = false; - var editableObject = MapControl.SelectTool.SelectedFeatureInteractors[0].EditableObject; var interactors = MapControl.SelectTool.SelectedFeatureInteractors.Where(featureMutator => featureMutator.AllowDeletion()).ToArray(); foreach (var interactor in interactors) { - if (!featuresDeleted && editableObject != null) - { - editableObject.BeginEdit("Delete feature(s)"); - } - interactor.Delete(); featuresDeleted = true; } @@ -58,11 +51,6 @@ return; } - if (editableObject != null) - { - editableObject.EndEdit(); - } - MapControl.SelectTool.Clear(); } Index: Core/GIS/src/Core.GIS.SharpMap.UI/Tools/MoveTool.cs =================================================================== diff -u -ree0b95b2a1a34d8e81a21c8d05ef1354169af50c -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap.UI/Tools/MoveTool.cs (.../MoveTool.cs) (revision ee0b95b2a1a34d8e81a21c8d05ef1354169af50c) +++ Core/GIS/src/Core.GIS.SharpMap.UI/Tools/MoveTool.cs (.../MoveTool.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -3,8 +3,6 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; -using Core.Common.Utils; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.CoordinateSystems.Transformations; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; @@ -236,7 +234,7 @@ if (MouseMoved(worldPosition, mouseDownLocation) && MapControl.SelectTool.SelectedFeatureInteractors.Count > 0) { var interactor = trackerFeature.FeatureInteractor; - DoEditAction(interactor.EditableObject, interactor.SourceFeature, () => interactor.Stop(snapResult)); + interactor.Stop(snapResult); Map.GetLayerByFeature(interactor.SourceFeature).RenderRequired = true; } @@ -355,21 +353,6 @@ return !selectTool.KeyToggleSelection && !selectTool.KeyExtendSelection && trackerAlreadySelected; } - private static void DoEditAction(IEditableObject editableObject, IFeature sourceFeature, Action editAction) - { - if (editableObject != null) - { - editableObject.BeginEdit(string.Format("Move feature {0}", sourceFeature.Name)); - } - - editAction(); - - if (editableObject != null) - { - editableObject.EndEdit(); - } - } - private void ResetDragLayers() { foreach (var layer in dragLayers) Index: Core/GIS/src/Core.GIS.SharpMap/Editors/FeatureInteractor.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap/Editors/FeatureInteractor.cs (.../FeatureInteractor.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/src/Core.GIS.SharpMap/Editors/FeatureInteractor.cs (.../FeatureInteractor.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -3,7 +3,6 @@ using System.Linq; using System.Reflection; using System.Windows.Forms; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.NetTopologySuite.Extensions.Geometries; @@ -27,13 +26,13 @@ private readonly List trackers = new List(); private IFeature sourceFeature; - protected FeatureInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, IEditableObject editableObject) + protected FeatureInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, object targetObject) { Layer = layer; SourceFeature = feature; VectorStyle = vectorStyle; FeatureRelationEditors = new List(); - EditableObject = editableObject; + TargetObject = targetObject; CreateTrackers(); } @@ -60,7 +59,7 @@ public virtual IFallOffPolicy FallOffPolicy { get; set; } - public virtual IEditableObject EditableObject { get; set; } + public virtual object TargetObject { get; set; } public virtual IList Trackers { Index: Core/GIS/src/Core.GIS.SharpMap/Editors/Interactors/LineStringInteractor.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap/Editors/Interactors/LineStringInteractor.cs (.../LineStringInteractor.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/src/Core.GIS.SharpMap/Editors/Interactors/LineStringInteractor.cs (.../LineStringInteractor.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -4,7 +4,6 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Utils.Collections.Extensions; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.SharpMap.Api.Editors; @@ -22,8 +21,8 @@ private static Bitmap trackerSmall; private static Bitmap selectedTrackerSmall; - public LineStringInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, IEditableObject editableObject) - : base(layer, feature, vectorStyle, editableObject) {} + public LineStringInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, object targetObject) + : base(layer, feature, vectorStyle, targetObject) {} public override TrackerFeature GetTrackerAtCoordinate(ICoordinate worldPos) { Index: Core/GIS/src/Core.GIS.SharpMap/Editors/Interactors/PointInteractor.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/src/Core.GIS.SharpMap/Editors/Interactors/PointInteractor.cs (.../PointInteractor.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/src/Core.GIS.SharpMap/Editors/Interactors/PointInteractor.cs (.../PointInteractor.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -1,6 +1,5 @@ using System.Drawing; using System.Windows.Forms; -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.SharpMap.Api.Editors; @@ -12,8 +11,8 @@ { public class PointInteractor : FeatureInteractor { - public PointInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, IEditableObject editableObject) - : base(layer, feature, vectorStyle, editableObject) {} + public PointInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, object targetObject) + : base(layer, feature, vectorStyle, targetObject) {} public override Cursor GetCursor(TrackerFeature trackerFeature) { Index: Core/GIS/test/Core.GIS.SharpMap.Tests/Editors/FeatureInteractorTest.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/test/Core.GIS.SharpMap.Tests/Editors/FeatureInteractorTest.cs (.../FeatureInteractorTest.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/test/Core.GIS.SharpMap.Tests/Editors/FeatureInteractorTest.cs (.../FeatureInteractorTest.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -1,5 +1,4 @@ -using Core.Common.Utils.Editing; -using Core.GIS.GeoAPI.Extensions.Feature; +using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.SharpMap.Api.Layers; using Core.GIS.SharpMap.Editors; using Core.GIS.SharpMap.Layers; @@ -83,8 +82,8 @@ private class TestFeatureInteractor : FeatureInteractor { - public TestFeatureInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, IEditableObject editableObject) - : base(layer, feature, vectorStyle, editableObject) {} + public TestFeatureInteractor(ILayer layer, IFeature feature, VectorStyle vectorStyle, object targetObject) + : base(layer, feature, vectorStyle, targetObject) {} public bool IsEditable { get; set; } Index: Core/GIS/test/Core.GIS.SharpMap.UI.Tests/Tools/DeleteToolTest.cs =================================================================== diff -u -r9f01c4daf5b7af6549045ed6ac404d18419c2555 -r22469012664426d8196f8cd350cde57a8a50bc70 --- Core/GIS/test/Core.GIS.SharpMap.UI.Tests/Tools/DeleteToolTest.cs (.../DeleteToolTest.cs) (revision 9f01c4daf5b7af6549045ed6ac404d18419c2555) +++ Core/GIS/test/Core.GIS.SharpMap.UI.Tests/Tools/DeleteToolTest.cs (.../DeleteToolTest.cs) (revision 22469012664426d8196f8cd350cde57a8a50bc70) @@ -1,4 +1,3 @@ -using Core.Common.Utils.Editing; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.NetTopologySuite.Extensions.Features; using Core.GIS.NetTopologySuite.Geometries; @@ -55,13 +54,9 @@ mapControl.Map.Layers.Add(vectorLayer); var featureMutator = mocks.StrictMock(); - var editableObject = mocks.StrictMock(); - featureMutator.Expect(fm => fm.EditableObject).Return(editableObject).Repeat.Any(); featureMutator.Expect(fm => fm.AllowDeletion()).Return(false).Repeat.Any(); featureMutator.Expect(fm => fm.Delete()).Repeat.Never(); - editableObject.Expect(eo => eo.BeginEdit(null)).IgnoreArguments().Repeat.Never(); //never expect BeginEdit! - editableObject.Expect(eo => eo.EndEdit()).IgnoreArguments().Repeat.Never(); mocks.ReplayAll(); @@ -92,14 +87,10 @@ mapControl.Map.Layers.Add(vectorLayer); var featureMutator = mocks.StrictMock(); - var editableObject = mocks.StrictMock(); - - featureMutator.Expect(fm => fm.EditableObject).Return(editableObject).Repeat.Any(); + featureMutator.Expect(fm => fm.AllowDeletion()).Return(true).Repeat.Any(); featureMutator.Expect(fm => fm.Delete()).Repeat.Once(); - editableObject.Expect(eo => eo.BeginEdit(null)).IgnoreArguments().Repeat.Once(); //expect BeginEdit! - editableObject.Expect(eo => eo.EndEdit()).IgnoreArguments().Repeat.Once(); - + mocks.ReplayAll(); selectTool.Select((IFeature) layer2Data.Features[0]);