Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj
===================================================================
diff -u -rea23f63aaa17ddf43d3e5c753a53515a504ece38 -r17078d665c331e81a75521b7df713514fb6b76ae
--- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision ea23f63aaa17ddf43d3e5c753a53515a504ece38)
+++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 17078d665c331e81a75521b7df713514fb6b76ae)
@@ -222,7 +222,6 @@
-
Fisheye: Tag 17078d665c331e81a75521b7df713514fb6b76ae refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Gui/ILayerEditorView.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs
===================================================================
diff -u -r2316f13e1e3c4a7f31e0d96faa84e71edf8bf325 -r17078d665c331e81a75521b7df713514fb6b76ae
--- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs (.../MapView.cs) (revision 2316f13e1e3c4a7f31e0d96faa84e71edf8bf325)
+++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs (.../MapView.cs) (revision 17078d665c331e81a75521b7df713514fb6b76ae)
@@ -3,10 +3,8 @@
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
-using Core.Common.Controls;
using Core.Common.Controls.Swf;
using Core.Common.Controls.Views;
-using Core.Common.Gui;
using Core.Common.Utils.Events;
using Core.GIS.GeoAPI.Extensions.Feature;
using Core.GIS.GeoAPI.Geometries;
@@ -42,7 +40,6 @@
};
Controls.Add(TabControl);
- MapControl.SelectedFeaturesChanged += (s, e) => SyncMapViewEditorSelection();
Splitter.ControlToHide = TabControl;
TabControl.ViewCollectionChanged += OnTabControlOnViewCollectionChanged;
@@ -477,49 +474,10 @@
OnMouseEnter(e);
}
- private void SyncMapViewEditorSelection()
- {
- var features = MapControl.SelectedFeatures;
- if (features == null || settingSelection)
- {
- return;
- }
-
- settingSelection = true;
-
- features = features.ToList();
-
- foreach (var mapViewEditor in TabControl.ChildViews.OfType())
- {
- mapViewEditor.SelectedFeatures = features;
- }
- settingSelection = false;
- }
-
- private void MapEditorSelectedFeaturesChanged(object sender, EventArgs e)
- {
- var mapViewEditor = sender as ILayerEditorView;
- if (mapViewEditor == null || settingSelection)
- {
- return;
- }
-
- settingSelection = true;
- MapControl.SelectTool.Select(mapViewEditor.SelectedFeatures);
- settingSelection = false;
- }
-
private void OnTabControlOnViewCollectionChanged(object s, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
- var mapEditor = e.NewItems != null ? e.NewItems.OfType().FirstOrDefault() : null;
-
- if (mapEditor != null)
- {
- mapEditor.SelectedFeaturesChanged += MapEditorSelectedFeaturesChanged;
- mapEditor.Layer = GetLayerForData != null ? GetLayerForData(mapEditor.Data) : null;
- }
if (!IsTabControlVisible)
{
IsTabControlVisible = true;
@@ -528,15 +486,6 @@
if (e.Action == NotifyCollectionChangedAction.Remove)
{
- var mapEditor = e.OldItems != null ? e.OldItems.OfType().FirstOrDefault() : null;
- if (mapEditor != null)
- {
- mapEditor.SelectedFeaturesChanged -= MapEditorSelectedFeaturesChanged;
- mapEditor.Layer = null;
- mapEditor.Data = null;
- mapEditor.Dispose();
- }
-
if (IsTabControlVisible && !TabControl.ChildViews.Any())
{
IsTabControlVisible = false;
Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.Designer.cs
===================================================================
diff -u -ra950714ad9510756331d862aa35695fa0b2ed03b -r17078d665c331e81a75521b7df713514fb6b76ae
--- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.Designer.cs (.../MapViewTabControl.Designer.cs) (revision a950714ad9510756331d862aa35695fa0b2ed03b)
+++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.Designer.cs (.../MapViewTabControl.Designer.cs) (revision 17078d665c331e81a75521b7df713514fb6b76ae)
@@ -19,7 +19,6 @@
{
if (dockingManager != null)
{
- dockingManager.ActiveContentChanged -= DockingManagerActiveContentChanged;
dockingManager.DocumentClosed -= DockingManagerOnDocumentClosed;
}
Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.cs
===================================================================
diff -u -r40a3475dedb6ce5aacbd38a6d7b8445665fb98cd -r17078d665c331e81a75521b7df713514fb6b76ae
--- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.cs (.../MapViewTabControl.cs) (revision 40a3475dedb6ce5aacbd38a6d7b8445665fb98cd)
+++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.cs (.../MapViewTabControl.cs) (revision 17078d665c331e81a75521b7df713514fb6b76ae)
@@ -29,7 +29,6 @@
elementHost.Child = dockingManager;
dockingManager.Layout.RootPanel.Children.Clear();
- dockingManager.ActiveContentChanged += DockingManagerActiveContentChanged;
dockingManager.DocumentClosed += DockingManagerOnDocumentClosed;
}
@@ -127,65 +126,6 @@
OnViewCollectionChanged(NotifyCollectionChangedAction.Remove, view);
}
- public void BeforeDispose()
- {
- var activeView = ActiveView;
- var layerEditor = activeView as ILayerEditorView;
- if (layerEditor != null)
- {
- layerEditor.OnDeactivated();
- }
- }
-
- private void DockingManagerActiveContentChanged(object sender, EventArgs e)
- {
- if (nested)
- {
- return;
- }
-
- // nothing changes
- if (Equals(dockingManager.Layout.LastFocusedDocument, dockingManager.Layout.ActiveContent))
- {
- return;
- }
-
- var previousView = GetViewForDocument(dockingManager.Layout.LastFocusedDocument) as ILayerEditorView;
- var activeView = GetViewForDocument(dockingManager.Layout.ActiveContent) as ILayerEditorView;
-
- if (previousView != null)
- {
- previousView.OnDeactivated();
-
- // The below code confuses AvalonDock, causing tab switches to fail, but removing it gives
- // problems with changes not being committed. Unfortunately its very hard to write a test
- // for that. These problems also occur without this code, although it seems less often.
- nested = true;
- try
- {
- ControlHelper.UnfocusActiveControl(previousView as IContainerControl);
- }
- finally
- {
- nested = false;
- }
- }
-
- if (activeView != null)
- {
- activeView.OnActivated();
- }
- }
-
- private static IView GetViewForDocument(LayoutContent document)
- {
- if (document == null)
- {
- return null;
- }
- return (IView) ((WindowsFormsHost) document.Content).Child;
- }
-
private void DockingManagerOnDocumentClosed(object sender, DocumentClosedEventArgs documentClosedEventArgs)
{
var viewHost = (WindowsFormsHost) documentClosedEventArgs.Document.Content;
Index: Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Core.Plugins.SharpMapGis.Test.csproj
===================================================================
diff -u -r2316f13e1e3c4a7f31e0d96faa84e71edf8bf325 -r17078d665c331e81a75521b7df713514fb6b76ae
--- Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Core.Plugins.SharpMapGis.Test.csproj (.../Core.Plugins.SharpMapGis.Test.csproj) (revision 2316f13e1e3c4a7f31e0d96faa84e71edf8bf325)
+++ Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Core.Plugins.SharpMapGis.Test.csproj (.../Core.Plugins.SharpMapGis.Test.csproj) (revision 17078d665c331e81a75521b7df713514fb6b76ae)
@@ -98,7 +98,6 @@
-
Fisheye: Tag 17078d665c331e81a75521b7df713514fb6b76ae refers to a dead (removed) revision in file `Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Forms/MapViewTabControlTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Forms/MapViewTest.cs
===================================================================
diff -u -r2316f13e1e3c4a7f31e0d96faa84e71edf8bf325 -r17078d665c331e81a75521b7df713514fb6b76ae
--- Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Forms/MapViewTest.cs (.../MapViewTest.cs) (revision 2316f13e1e3c4a7f31e0d96faa84e71edf8bf325)
+++ Core/Plugins/test/Core.Plugins.SharpMapGis.Test/Forms/MapViewTest.cs (.../MapViewTest.cs) (revision 17078d665c331e81a75521b7df713514fb6b76ae)
@@ -1,12 +1,9 @@
using System.Drawing;
using System.IO;
using System.Linq;
-using Core.Common.Controls.Views;
using Core.Common.Gui;
using Core.Common.TestUtil;
-using Core.Common.Utils.Reflection;
using Core.GIS.NetTopologySuite.Geometries;
-using Core.GIS.SharpMap.Api.Collections;
using Core.GIS.SharpMap.Data.Providers;
using Core.GIS.SharpMap.Extensions.CoordinateSystems;
using Core.GIS.SharpMap.Layers;
@@ -16,7 +13,6 @@
using Core.Plugins.SharpMapGis.Gui.Forms;
using Core.Plugins.SharpMapGis.Gui.Forms.MapLegendView;
using NUnit.Framework;
-using Rhino.Mocks;
namespace Core.Plugins.SharpMapGis.Test.Forms
{
@@ -159,47 +155,6 @@
}
}
- [Test]
- public void RemovingGroupLayerShouldCloseOpenTabsForSubLayers()
- {
- var groupLayer = new GroupLayer();
- var subLayer = new VectorLayer();
-
- var mocks = new MockRepository();
- var tabControl = mocks.Stub();
- var mapViewEditor = mocks.StrictMock();
-
- var layerEditorViews = new EventedList
- {
- mapViewEditor
- };
-
- tabControl.Expect(tc => tc.ChildViews).Return(layerEditorViews).Repeat.Any();
-
- mapViewEditor.Expect(me => me.Data).Return(subLayer).Repeat.Any();
-
- // During the mapView.Map.Layers.Clear() the subView should :
- // be removed from the tabControl, have its data set to null and be disposed
- tabControl.Expect(tc => tc.RemoveView(mapViewEditor));
-
- mocks.ReplayAll();
-
- var mapView = new MapView
- {
- GetDataForLayer = l => l
- };
-
- groupLayer.Layers.Add(subLayer);
- mapView.Map.Layers.Add(groupLayer);
-
- // use mocked tab control to check the removing of the sub-layer view
- TypeUtils.SetPrivatePropertyValue(mapView, "TabControl", tabControl);
-
- mapView.Map.Layers.Clear();
-
- mocks.VerifyAll();
- }
-
[TestFixtureSetUp]
public void TestFixtureSetUp()
{