Index: Core/Common/src/Core.Common.Gui/GuiPlugin.cs =================================================================== diff -u -r15921b5312f19713e98530b4f852ba2c7e898b03 -rda41c27c4bf84199e199322cce445e490aacff08 --- Core/Common/src/Core.Common.Gui/GuiPlugin.cs (.../GuiPlugin.cs) (revision 15921b5312f19713e98530b4f852ba2c7e898b03) +++ Core/Common/src/Core.Common.Gui/GuiPlugin.cs (.../GuiPlugin.cs) (revision da41c27c4bf84199e199322cce445e490aacff08) @@ -46,17 +46,6 @@ } /// - /// Provides custom object map layers. - /// - public virtual IMapLayerProvider MapLayerProvider - { - get - { - return null; - } - } - - /// /// Returns all property information objects supported by the plugin /// public virtual IEnumerable GetPropertyInfos() Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Core.Plugins.SharpMapGis.Gui.csproj =================================================================== diff -u -r2a90c0c1be6114f72af65c42f0a6f334b30e4755 -rda41c27c4bf84199e199322cce445e490aacff08 --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Core.Plugins.SharpMapGis.Gui.csproj (.../Core.Plugins.SharpMapGis.Gui.csproj) (revision 2a90c0c1be6114f72af65c42f0a6f334b30e4755) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Core.Plugins.SharpMapGis.Gui.csproj (.../Core.Plugins.SharpMapGis.Gui.csproj) (revision da41c27c4bf84199e199322cce445e490aacff08) @@ -66,12 +66,6 @@ - - UserControl - - - ProjectItemMapView.cs - @@ -142,9 +136,6 @@ - - ProjectItemMapView.cs - MapLegendView.cs Designer Fisheye: Tag da41c27c4bf84199e199322cce445e490aacff08 refers to a dead (removed) revision in file `Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/ProjectItemMapView.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag da41c27c4bf84199e199322cce445e490aacff08 refers to a dead (removed) revision in file `Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/ProjectItemMapView.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag da41c27c4bf84199e199322cce445e490aacff08 refers to a dead (removed) revision in file `Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/Forms/ProjectItemMapView.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs =================================================================== diff -u -r15921b5312f19713e98530b4f852ba2c7e898b03 -rda41c27c4bf84199e199322cce445e490aacff08 --- Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs (.../SharpMapGisGuiPlugin.cs) (revision 15921b5312f19713e98530b4f852ba2c7e898b03) +++ Core/Plugins/src/Core.Plugins.SharpMapGis.Gui/SharpMapGisGuiPlugin.cs (.../SharpMapGisGuiPlugin.cs) (revision da41c27c4bf84199e199322cce445e490aacff08) @@ -13,7 +13,6 @@ using Core.Common.Gui.Forms; using Core.Common.Utils; using Core.GIS.GeoAPI.Extensions.Feature; -using Core.GIS.SharpMap.Api.Layers; using Core.GIS.SharpMap.Layers; using Core.GIS.SharpMap.Map; using Core.GIS.SharpMap.UI.Forms; @@ -88,64 +87,6 @@ } } - /// - /// Creates a object for - /// a IEnumerable of TFeature that is present part of a TFeatureContainer - /// - /// - /// Model - boundaries - /// - /// var viewInfo = CreateAttributeTableViewInfo]]>(m => m.Boundaries, () => Gui) - /// - /// - /// Type of the sub features - /// Type of the feature container - /// Function for getting the IEnumerable of from - /// Function for getting an - public static ViewInfo, ILayer, VectorLayerAttributeTableView> CreateAttributeTableViewInfo(Func> getCollection, Func getGui) - { - return new ViewInfo, ILayer, VectorLayerAttributeTableView> - { - Description = "Attribute Table", - GetViewName = (v, o) => o.Name, - AdditionalDataCheck = o => - { - var container = getGui().Application.Project.Items.OfType().FirstOrDefault(fc => Equals(o, getCollection(fc))); - return container != null; - }, - GetViewData = o => - { - var centralMap = getGui().DocumentViews.OfType() - .FirstOrDefault(v => v.MapView.GetLayerForData(o) != null); - return centralMap == null ? null : centralMap.MapView.GetLayerForData(o); - }, - CompositeViewType = typeof(ProjectItemMapView), - GetCompositeViewData = o => getGui().Application.Project.Items.OfType().FirstOrDefault(fc => - { - if (fc is TFeatureContainer) - { - return Equals(o, getCollection((TFeatureContainer) fc)); - } - - return false; - }), - AfterCreate = (v, o) => - { - var centralMap = getGui().DocumentViews.OfType() - .FirstOrDefault(vi => vi.MapView.GetLayerForData(o) != null); - if (centralMap == null) - { - return; - } - - v.DeleteSelectedFeatures = () => centralMap.MapView.MapControl.DeleteTool.DeleteSelection(); - v.OpenViewMethod = ob => getGui().CommandHandler.OpenView(ob); - v.ZoomToFeature = feature => centralMap.MapView.EnsureVisible(feature); - v.CanAddDeleteAttributes = false; - } - }; - } - public void InitializeMapLegend() { if ((mapLegendView == null) || (mapLegendView.IsDisposed)) @@ -258,45 +199,10 @@ { Description = "Map" }; - yield return new ViewInfo - { - Description = "Attribute table", - CompositeViewType = typeof(ProjectItemMapView), - GetViewName = (v, o) => o.Name + " Attributes" - }; yield return new ViewInfo { Description = "Table" }; - yield return new ViewInfo - { - Description = "Map", - AdditionalDataCheck = o => CanLayerProvidersCreateLayerFor(o), - GetViewData = o => o, - GetViewName = (v, o) => o.Name, - OnActivateView = (v, o) => - { - var layerData = o; - var layer = v.MapView.GetLayerForData(layerData); - if (layer != null) - { - v.MapView.EnsureVisible(layer); - - if (MapLegendView != null) - { - MapLegendView.EnsureVisible(layer); - } - } - }, - AfterCreate = (v, o) => - { - var mapLayerProviders = Gui.Plugins.Select(p => p.MapLayerProvider).Where(p => p != null).ToList(); - - v.CreateLayerForData = (lo, ld) => MapLayerProviderHelper.CreateLayersRecursive(lo, null, mapLayerProviders, ld); - v.RefreshLayersAction = (l, ld, po) => MapLayerProviderHelper.RefreshLayersRecursive(l, ld, mapLayerProviders, po); - }, - CloseForData = (v, o) => v.Data.Equals(o) // only close the view if it is the root object - }; } public override ContextMenuStrip GetContextMenu(object sender, object data) @@ -486,17 +392,5 @@ gui.CommandHandler.OpenView(data); } - - private bool CanLayerProvidersCreateLayerFor(object data) - { - if (Gui == null || Gui.Plugins == null) - { - return false; - } - - return Gui.Plugins.Select(p => p.MapLayerProvider) - .Where(p => p != null) - .Any(p => p.CanCreateLayerFor(data, Gui.SelectedProjectItem)); - } } } \ No newline at end of file Index: Core/Plugins/src/Core.Plugins.SharpMapGis/SharpMapGisApplicationPlugin.cs =================================================================== diff -u -rfb6f952991193be2c30995f3f8e60312c12dc052 -rda41c27c4bf84199e199322cce445e490aacff08 --- Core/Plugins/src/Core.Plugins.SharpMapGis/SharpMapGisApplicationPlugin.cs (.../SharpMapGisApplicationPlugin.cs) (revision fb6f952991193be2c30995f3f8e60312c12dc052) +++ Core/Plugins/src/Core.Plugins.SharpMapGis/SharpMapGisApplicationPlugin.cs (.../SharpMapGisApplicationPlugin.cs) (revision da41c27c4bf84199e199322cce445e490aacff08) @@ -14,16 +14,16 @@ public override IEnumerable GetDataItemInfos() { - // yield return new DataItemInfo - // { - // Name = "Map", - // Category = "General", - // Image = Properties.Resources.Map, - // CreateData = owner => new Map - // { - // Name = "Map" - // } - // }; +// yield return new DataItemInfo +// { +// Name = "Map", +// Category = "General", +// Image = Properties.Resources.Map, +// CreateData = owner => new Map +// { +// Name = "Map" +// } +// }; yield break; }