Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -rb0af17a5bd9c637b182784a75123ad2ca898b152 -rb519fc798c63691f04bb8008b562a94ed9232d51 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision b0af17a5bd9c637b182784a75123ad2ca898b152) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision b519fc798c63691f04bb8008b562a94ed9232d51) @@ -94,7 +94,6 @@ using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; using RingtoetsCommonServiceResources = Ringtoets.Common.Service.Properties.Resources; -using RingtoetsCommonIoResources = Ringtoets.Common.IO.Properties.Resources; using RingtoetsIntegrationPluginResources = Ringtoets.Integration.Plugin.Properties.Resources; using BaseResources = Core.Common.Base.Properties.Resources; using GuiResources = Core.Common.Gui.Properties.Resources; @@ -275,9 +274,9 @@ { yield return new PropertyInfo(); yield return new PropertyInfo(); - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = container => new BackgroundMapDataContainerProperties(container) + CreateInstance = container => new BackgroundMapDataProperties(container) }; yield return new PropertyInfo(); yield return new PropertyInfo @@ -515,14 +514,14 @@ OnNodeRemoved = AssessmentSectionOnNodeRemoved }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { Text = container => RingtoetsIntegrationPluginResources.RingtoetsPlugin_BackgroundMapDataContext_Text, Image = container => RingtoetsFormsResources.Map, - ContextMenuStrip = BackgroundMapDataContainerMenuStrip, - ForeColor = container => container.MapData != null && container.MapData.IsConfigured ? - Color.FromKnownColor(KnownColor.ControlText) : - Color.FromKnownColor(KnownColor.GrayText) + ContextMenuStrip = BackgroundMapDataMenuStrip, + ForeColor = data => data.IsConfigured ? + Color.FromKnownColor(KnownColor.ControlText) : + Color.FromKnownColor(KnownColor.GrayText) }; yield return new TreeNodeInfo @@ -884,32 +883,32 @@ } } - #region BackgroundMapDataContext treeNodeInfo + #region BackgroundMapData treeNodeInfo - private ContextMenuStrip BackgroundMapDataContainerMenuStrip(BackgroundMapDataContainer nodeData, object parentData, TreeViewControl treeViewControl) + private ContextMenuStrip BackgroundMapDataMenuStrip(BackgroundMapData nodeData, object parentData, TreeViewControl treeViewControl) { var assessmentSection = parentData as IAssessmentSection; var mapDataItem = new StrictContextMenuItem( RingtoetsIntegrationPluginResources.BackgroundMapData_SelectMapData, RingtoetsIntegrationPluginResources.BackgroundMapData_SelectMapData_Tooltip, - RingtoetsCommonFormsResources.MapsIcon, (sender, args) => SelectMapData(assessmentSection, nodeData)); + RingtoetsCommonFormsResources.MapsIcon, (sender, args) => { SelectMapData(assessmentSection, nodeData); }); return Gui.Get(nodeData, treeViewControl) .AddCustomItem(mapDataItem) .AddPropertiesItem() .Build(); } - private void SelectMapData(IAssessmentSection assessmentSection, BackgroundMapDataContainer container) + private void SelectMapData(IAssessmentSection assessmentSection, BackgroundMapData backgroundMapData) { if (assessmentSection == null) { return; } - WmtsMapData currentMapData = container.MapData as WmtsMapData; - using (var dialog = new BackgroundMapDataSelectionDialog(Gui.MainWindow, currentMapData)) + WmtsMapData currentData = RingtoetsBackgroundMapDataFactory.CreateBackgroundMapData(backgroundMapData); + using (var dialog = new BackgroundMapDataSelectionDialog(Gui.MainWindow, currentData)) { if (dialog.ShowDialog() == DialogResult.OK) { @@ -920,9 +919,27 @@ private static void SetSelectedMapData(IAssessmentSection assessmentSection, ImageBasedMapData selectedMapData) { - assessmentSection.BackgroundMapData.MapData = selectedMapData; - assessmentSection.BackgroundMapData.IsVisible = selectedMapData != null; - assessmentSection.BackgroundMapData.NotifyObservers(); + assessmentSection.BackgroundMapData2.Name = string.Empty; + assessmentSection.BackgroundMapData2.IsVisible = false; + assessmentSection.BackgroundMapData2.Parameters.Clear(); + + if (selectedMapData != null) + { + selectedMapData.IsVisible = true; + assessmentSection.BackgroundMapData2.IsVisible = selectedMapData.IsVisible; + assessmentSection.BackgroundMapData2.IsConfigured = selectedMapData.IsConfigured; + assessmentSection.BackgroundMapData2.Name = selectedMapData.Name; + + var selectedWmtsMapData = selectedMapData as WmtsMapData; + if (selectedWmtsMapData != null) + { + assessmentSection.BackgroundMapData2.Parameters["SourceCapabilitiesUrl"] = selectedWmtsMapData.SourceCapabilitiesUrl; + assessmentSection.BackgroundMapData2.Parameters["SelectedCapabilityIdentifier"] = selectedWmtsMapData.SelectedCapabilityIdentifier; + assessmentSection.BackgroundMapData2.Parameters["PreferredFormat"] = selectedWmtsMapData.PreferredFormat; + } + } + + assessmentSection.BackgroundMapData2.NotifyObservers(); assessmentSection.NotifyObservers(); } @@ -1101,7 +1118,7 @@ { var childNodes = new List { - nodeData.BackgroundMapData, + nodeData.BackgroundMapData2, new ReferenceLineContext(nodeData), new FailureMechanismContributionContext(nodeData.FailureMechanismContribution, nodeData), new HydraulicBoundaryDatabaseContext(nodeData),