Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewList.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewList.cs (.../ViewList.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewList.cs (.../ViewList.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -85,7 +85,7 @@ { get { - return FindViewsRecursive(views); + return views; } } @@ -202,14 +202,6 @@ } } - public IEnumerable GetActiveViews() where T : class, IView - { - return FindViewsRecursive(new[] - { - ActiveView - }); - } - public IEnumerator GetEnumerator() { return views.GetEnumerator(); @@ -252,17 +244,6 @@ return views.GetEnumerator(); } - public IEnumerable FindViewsRecursive(IEnumerable views) where T : class, IView - { - foreach (var view in views) - { - if (view is T) - { - yield return (T) view; - } - } - } - private void ActivateView(IView view) { if (clearing) Index: Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewResolver.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewResolver.cs (.../ViewResolver.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Common/src/Core.Common.Gui/Forms/ViewManager/ViewResolver.cs (.../ViewResolver.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -217,10 +217,11 @@ return true; } - var reusableView = FindViewsRecursive(viewList).FirstOrDefault(rv => - !rv.Locked && - IsDataForView(rv, viewData) && - viewInfo.ViewDataType == rv.ViewInfo.ViewDataType); + var reusableView = viewList.OfType() + .FirstOrDefault(rv => + !rv.Locked && + IsDataForView(rv, viewData) && + viewInfo.ViewDataType == rv.ViewInfo.ViewDataType); if (reusableView != null) { @@ -359,16 +360,5 @@ return defaultViewTypes.Keys.Contains(selectionType) ? defaultViewTypes[selectionType] : null; } - - private IEnumerable FindViewsRecursive(IEnumerable views) - { - foreach (var view in views) - { - if (view is T) - { - yield return (T) view; - } - } - } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/IViewList.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Common/src/Core.Common.Gui/IViewList.cs (.../IViewList.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Common/src/Core.Common.Gui/IViewList.cs (.../IViewList.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -67,21 +67,6 @@ void UpdateViewName(IView view); /// - /// Returns views of type T that are (part of) the active view. - /// - /// Type of view to look for - /// Views of type - IEnumerable GetActiveViews() where T : class, IView; - - /// - /// Returns views of type T that are (part of) the supplied - /// - /// Type of view to look for - /// Views to search - /// Views of type - IEnumerable FindViewsRecursive(IEnumerable views) where T : class, IView; - - /// /// Overloaded Clear, removes all views except /// /// Index: Core/Common/uml/Core.Common.Gui.UML/ViewManager.cd =================================================================== diff -u -r79a816a478616907118e0d953a3bdd26a9c99af8 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Common/uml/Core.Common.Gui.UML/ViewManager.cd (.../ViewManager.cd) (revision 79a816a478616907118e0d953a3bdd26a9c99af8) +++ Core/Common/uml/Core.Common.Gui.UML/ViewManager.cd (.../ViewManager.cd) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -11,10 +11,6 @@ - - - - Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ChartViewCommandBase.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ChartViewCommandBase.cs (.../ChartViewCommandBase.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/ChartViewCommandBase.cs (.../ChartViewCommandBase.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -1,6 +1,5 @@ using System.Drawing; using Core.Common.Controls.Swf.Charting; -using Core.Common.Controls.Views; using Core.Common.Gui; namespace Core.Plugins.CommonTools.Gui.Commands.Charting @@ -28,7 +27,7 @@ get { return Gui != null - ? GetViewRecursive(Gui.DocumentViews.ActiveView) + ? Gui.DocumentViews.ActiveView as ChartView : null; } } @@ -37,15 +36,5 @@ { return new Font(font.FontFamily, font.Size + pixels, font.Style); } - - private T GetViewRecursive(IView view) where T : class, IView - { - if (view is T) - { - return (T) view; - } - - return null; - } } } \ No newline at end of file Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs (.../RulerCommand.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Commands/Charting/RulerCommand.cs (.../RulerCommand.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -38,12 +38,12 @@ { get { - var chartView = GetChartViewWithRulerRecursive(Gui.DocumentViews.ActiveView); + var chartView = GetChartViewWithRuler(Gui.DocumentViews.ActiveView); return chartView == null ? null : chartView.GetTool() as RulerTool; } } - private ChartView GetChartViewWithRulerRecursive(IView view) + private ChartView GetChartViewWithRuler(IView view) { var chartView = view as ChartView; Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/CommonToolsGuiPlugin.cs =================================================================== diff -u -r6da1665176a2096b51fa01a977c82a77530bf88a -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.CommonTools.Gui/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision 6da1665176a2096b51fa01a977c82a77530bf88a) +++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/CommonToolsGuiPlugin.cs (.../CommonToolsGuiPlugin.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -1,20 +1,15 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Reflection; using Core.Common.Base.Data; using Core.Common.Controls; using Core.Common.Controls.Swf; using Core.Common.Controls.Swf.Charting; using Core.Common.Controls.Swf.Charting.Series; -using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Gui.Forms; using Core.Common.Gui.Swf; using Core.Common.Utils; using Core.Common.Utils.Collections; -using Core.Plugins.CommonTools.Gui.Forms; using Core.Plugins.CommonTools.Gui.Forms.Charting; using Core.Plugins.CommonTools.Gui.Properties; using Core.Plugins.CommonTools.Gui.Property; @@ -151,11 +146,6 @@ base.Deactivate(); } - private void DocumentViewsOnChildViewChanged(object sender, NotifyCollectionChangingEventArgs notifyCollectionChangingEventArgs) - { - UpdateChartLegendView(); - } - private void DocumentViewsActiveViewChanged(object sender, ActiveViewChangeEventArgs e) { UpdateChartLegendView(); @@ -168,18 +158,19 @@ return; } - var chartViews = Gui.DocumentViews.FindViewsRecursive(new[] + var chartView = e.Item as ChartView; + if (chartView == null) { - e.Item as IView - }); + return; + } if (e.Action == NotifyCollectionChangeAction.Add) { - chartViews.ForEachElementDo(cv => cv.ToolsActiveChanged += ActiveToolsChanged); + chartView.ToolsActiveChanged += ActiveToolsChanged; } else if(e.Action == NotifyCollectionChangeAction.Remove) { - chartViews.ForEachElementDo(cv => cv.ToolsActiveChanged -= ActiveToolsChanged); + chartView.ToolsActiveChanged -= ActiveToolsChanged; } } @@ -195,7 +186,7 @@ return; } - var chartView = Gui.DocumentViews.GetActiveViews().FirstOrDefault(); + var chartView = Gui.DocumentViews.ActiveView as IChartView; if (chartView != null) { if (ChartLegendView.Data != chartView.Data) Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Commands/ZoomLayerCommand.cs =================================================================== diff -u -re8aaaf3808e54e4f075eab6f6c58bedf35e0890e -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Commands/ZoomLayerCommand.cs (.../ZoomLayerCommand.cs) (revision e8aaaf3808e54e4f075eab6f6c58bedf35e0890e) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Commands/ZoomLayerCommand.cs (.../ZoomLayerCommand.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -21,9 +21,8 @@ var manager = Gui.DocumentViews; // find the correct mapview - var mapView = manager.GetActiveViews().FirstOrDefault(v => Equals(v.Data, layer.Map)); - - if (mapView == null) + var mapView = manager.ActiveView as MapView; + if (mapView == null || !Equals(mapView.Data, layer.Map)) { return; } Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Core.Plugins.SharpMapGis.Gui.csproj =================================================================== diff -u -r5e8f24c2eade934e5e8ff0f4f510eb5fbd40ac67 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Core.Plugins.SharpMapGis.Gui.csproj (.../Core.Plugins.SharpMapGis.Gui.csproj) (revision 5e8f24c2eade934e5e8ff0f4f510eb5fbd40ac67) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Core.Plugins.SharpMapGis.Gui.csproj (.../Core.Plugins.SharpMapGis.Gui.csproj) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -121,7 +121,6 @@ - Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs (.../MapView.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs (.../MapView.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -8,7 +8,6 @@ using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Utils.Collections; -using Core.Common.Utils.Collections.Generic; using Core.GIS.GeoAPI.Extensions.Feature; using Core.GIS.GeoAPI.Geometries; using Core.GIS.NetTopologySuite.Geometries; @@ -305,22 +304,6 @@ } } - public IEventedList ChildViews - { - get - { - return TabControl.ChildViews; - } - } - - public bool HandlesChildViews - { - get - { - return true; - } - } - public IView OpenLayerAttributeTable(ILayer layer, Action openViewMethod = null) { if (!(layer is VectorLayer) || !layer.ShowAttributeTable) @@ -379,15 +362,6 @@ EnsureFeatureVisible(feature, layer); } - public void ActivateChildView(IView childView) - { - TabControl.ActiveView = childView; - if (IsTabControlVisible && Splitter.IsCollapsed) - { - Splitter.ToggleState(); //re-show tabcontrol now - } - } - /// /// Clean up any resources being used. /// Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.cs =================================================================== diff -u -r0c09106be1dfa0dad80232e39fea48b274ecdf37 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.cs (.../MapViewTabControl.cs) (revision 0c09106be1dfa0dad80232e39fea48b274ecdf37) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapViewTabControl.cs (.../MapViewTabControl.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -4,7 +4,6 @@ using System.Linq; using System.Windows.Forms; using System.Windows.Forms.Integration; -using Core.Common.Controls; using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Utils.Collections.Generic; Fisheye: Tag fefc0cc505a41a79d4643c80335484daf4ca30ce refers to a dead (removed) revision in file `Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/IGuiMapViewExtentions.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs =================================================================== diff -u -r0d8098264ea05ccbf529b3c2c54479fdbc0ef670 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs (.../SharpMapGisGuiPlugin.cs) (revision 0d8098264ea05ccbf529b3c2c54479fdbc0ef670) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs (.../SharpMapGisGuiPlugin.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -261,9 +261,9 @@ yield return new MapProjectTreeViewNodePresenter(); } - internal static MapView GetFocusedMapView(IView view = null) + internal static MapView GetFocusedMapView() { - return gui.GetFocusedMapView(view); + return gui.DocumentViews.ActiveView as MapView; } private void ApplicationProjectClosing(Project project) Index: Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/TestViewList.cs =================================================================== diff -u -r0c09106be1dfa0dad80232e39fea48b274ecdf37 -rfefc0cc505a41a79d4643c80335484daf4ca30ce --- Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/TestViewList.cs (.../TestViewList.cs) (revision 0c09106be1dfa0dad80232e39fea48b274ecdf37) +++ Core/Plugins/test/Core.Plugins.CommonTools.Gui.Test/TestViewList.cs (.../TestViewList.cs) (revision fefc0cc505a41a79d4643c80335484daf4ca30ce) @@ -2,7 +2,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using Core.Common.Controls; using Core.Common.Controls.Views; using Core.Common.Gui; using Core.Common.Utils.Collections; @@ -17,7 +16,6 @@ public event EventHandler ActiveViewChanging; - public event NotifyCollectionChangedEventHandler ChildViewChanged; #pragma warning restore 67 public event EventHandler ActiveViewChanged;