Index: Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj =================================================================== diff -u -r0c09106be1dfa0dad80232e39fea48b274ecdf37 -rcff3810225268135255996e7a2e86de4733b03e8 --- Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision 0c09106be1dfa0dad80232e39fea48b274ecdf37) +++ Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision cff3810225268135255996e7a2e86de4733b03e8) @@ -90,6 +90,8 @@ ExceptionDialog.cs + + Index: Core/Common/src/Core.Common.Controls/Views/IAdditionalView.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Controls/Views/IAdditionalView.cs (revision 0) +++ Core/Common/src/Core.Common.Controls/Views/IAdditionalView.cs (revision cff3810225268135255996e7a2e86de4733b03e8) @@ -0,0 +1,9 @@ +namespace Core.Common.Controls.Views +{ + /// + /// Marker interface to indicate this view is not a principal view of its current data object and therefore + /// should not be returned when asking for existing views for a data object. It will however be closed when + /// the data is removed. + /// + public interface IAdditionalView : IView {} +} \ No newline at end of file Index: Core/Common/src/Core.Common.Controls/Views/ICompositeView.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Controls/Views/ICompositeView.cs (revision 0) +++ Core/Common/src/Core.Common.Controls/Views/ICompositeView.cs (revision cff3810225268135255996e7a2e86de4733b03e8) @@ -0,0 +1,13 @@ +using Core.Common.Utils.Collections.Generic; + +namespace Core.Common.Controls.Views +{ + public interface ICompositeView : IView + { + IEventedList ChildViews { get; } + + bool HandlesChildViews { get; } + + void ActivateChildView(IView childView); + } +} \ No newline at end of file Index: Core/Common/src/Core.Common.Controls/Views/IView.cs =================================================================== diff -u -r0c09106be1dfa0dad80232e39fea48b274ecdf37 -rcff3810225268135255996e7a2e86de4733b03e8 --- Core/Common/src/Core.Common.Controls/Views/IView.cs (.../IView.cs) (revision 0c09106be1dfa0dad80232e39fea48b274ecdf37) +++ Core/Common/src/Core.Common.Controls/Views/IView.cs (.../IView.cs) (revision cff3810225268135255996e7a2e86de4733b03e8) @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Drawing; -using Core.Common.Utils.Collections.Generic; namespace Core.Common.Controls.Views { @@ -41,33 +39,4 @@ /// void EnsureVisible(object item); } - - public interface ICompositeView : IView - { - IEventedList ChildViews { get; } - - bool HandlesChildViews { get; } - - void ActivateChildView(IView childView); - } - - /// - /// View that can be searched by using the SearchDialog - /// TODO : change to ISearchable and move to a different place - /// - public interface ISearchableView : IView - { - /// - /// Returns the objects that where found using the text. - /// This will be called from a separate thread. - /// - IEnumerable> SearchItemsByText(string text, bool caseSensitive, Func isSearchCancelled, Action setProgressPercentage); - } - - /// - /// Marker interface to indicate this view is not a principal view of its current data object and therefore - /// should not be returned when asking for existing views for a data object. It will however be closed when - /// the data is removed. - /// - public interface IAdditionalView : IView {} } \ No newline at end of file Index: Core/Plugins/src/Core.Plugins.CommonTools.Gui/Forms/TextDocumentView.cs =================================================================== diff -u -r0c09106be1dfa0dad80232e39fea48b274ecdf37 -rcff3810225268135255996e7a2e86de4733b03e8 --- Core/Plugins/src/Core.Plugins.CommonTools.Gui/Forms/TextDocumentView.cs (.../TextDocumentView.cs) (revision 0c09106be1dfa0dad80232e39fea48b274ecdf37) +++ Core/Plugins/src/Core.Plugins.CommonTools.Gui/Forms/TextDocumentView.cs (.../TextDocumentView.cs) (revision cff3810225268135255996e7a2e86de4733b03e8) @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Windows.Forms; using Core.Common.Controls; using Core.Common.Controls.Views; @@ -10,7 +8,7 @@ namespace Core.Plugins.CommonTools.Gui.Forms { - public partial class TextDocumentView : UserControl, ISearchableView + public partial class TextDocumentView : UserControl, IView { private bool textModified; private bool settingContent; @@ -78,17 +76,6 @@ textBox.SelectionLength = text.Length; } - public IEnumerable> SearchItemsByText(string text, bool caseSensitive, Func isSearchCancelled, Action setProgressPercentage) - { - var lines = textDocument.Content.Split(new[] - { - "\r", - "\n", - "\n\r" - }, StringSplitOptions.RemoveEmptyEntries); - return lines.Where(l => caseSensitive ? l.Contains(text) : l.ToLower().Contains(text.ToLower())).Select(l => new Tuple(l, l)); - } - protected override void OnVisibleChanged(EventArgs e) { base.OnVisibleChanged(e); Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs =================================================================== diff -u -r0c09106be1dfa0dad80232e39fea48b274ecdf37 -rcff3810225268135255996e7a2e86de4733b03e8 --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs (.../MapView.cs) (revision 0c09106be1dfa0dad80232e39fea48b274ecdf37) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/MapView.cs (.../MapView.cs) (revision cff3810225268135255996e7a2e86de4733b03e8) @@ -24,15 +24,15 @@ namespace Core.Plugins.SharpMapGis.Gui.Forms { - public partial class MapView : UserControl, ICompositeView, ISearchableView + public partial class MapView : UserControl, ICompositeView { private bool canAddPoint = true; private bool canDeleteItem = true; private bool canMoveItem = true; private bool canMoveItemLinear = true; private bool canSelectItem = true; private bool settingSelection = false; - private ExportMapToImageMapTool exportMapToImageMapTool; + private readonly ExportMapToImageMapTool exportMapToImageMapTool; public MapView() { @@ -411,40 +411,6 @@ } } - public IEnumerable> SearchItemsByText(string text, bool caseSensitive, Func isSearchCancelled, Action setProgressPercentage) - { - var visibleLayers = Map.GetAllVisibleLayers(false).Where(l => l.DataSource != null && l.DataSource.Features != null).ToList(); - if (visibleLayers.Count == 0) - { - yield break; - } - - var percentageStep = 100.0/visibleLayers.Count; - var currentPercentage = 0.0; - - foreach (var layer in visibleLayers) - { - if (isSearchCancelled()) - { - yield break; - } - - var matchingItems = layer.DataSource.Features.OfType(). - Where(n => n.Name != null && - (caseSensitive - ? n.Name.Contains(text) - : n.Name.ToLower().Contains(text.ToLower()))); - - foreach (var item in matchingItems) - { - yield return new System.Tuple(string.Format("{0} ({1})", item.Name, layer.Name), item); - } - - currentPercentage += percentageStep; - setProgressPercentage((int) currentPercentage); - } - } - /// /// Clean up any resources being used. ///