Index: Demo/Riskeer/src/Demo.Riskeer/Commands/OpenAssemblyViewCommand.cs =================================================================== diff -u --- Demo/Riskeer/src/Demo.Riskeer/Commands/OpenAssemblyViewCommand.cs (revision 0) +++ Demo/Riskeer/src/Demo.Riskeer/Commands/OpenAssemblyViewCommand.cs (revision c9cd43d7f5600222d0fdbca94ca353a4cc2505df) @@ -0,0 +1,56 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Controls.Commands; +using Core.Common.Gui.Commands; +using Riskeer.Common.Data.AssessmentSection; + +namespace Demo.Riskeer.Commands +{ + public class OpenAssemblyViewCommand : ICommand + { + private readonly IViewCommands viewCommands; + + /// + /// Creates a new instance of . + /// + /// The to use internally. + public OpenAssemblyViewCommand(IViewCommands viewCommands) + { + this.viewCommands = viewCommands; + } + + public bool Checked + { + get + { + return false; + } + } + + public void Execute() + { + var backgroundData = new BackgroundData(new WellKnownBackgroundDataConfiguration(RiskeerWellKnownTileSource.BingAerial)); + + viewCommands.OpenView(backgroundData); + } + } +} Index: Demo/Riskeer/src/Demo.Riskeer/Demo.Riskeer.csproj =================================================================== diff -u -rfd49a5436bd5aadf30f8ad18d0fc5e28c9e22d2c -rc9cd43d7f5600222d0fdbca94ca353a4cc2505df --- Demo/Riskeer/src/Demo.Riskeer/Demo.Riskeer.csproj (.../Demo.Riskeer.csproj) (revision fd49a5436bd5aadf30f8ad18d0fc5e28c9e22d2c) +++ Demo/Riskeer/src/Demo.Riskeer/Demo.Riskeer.csproj (.../Demo.Riskeer.csproj) (revision c9cd43d7f5600222d0fdbca94ca353a4cc2505df) @@ -24,6 +24,7 @@ + Index: Demo/Riskeer/src/Demo.Riskeer/GUIs/DemoProjectPlugin.cs =================================================================== diff -u -r931a128f3ea23e41af2d46a1744e76290a97178d -rc9cd43d7f5600222d0fdbca94ca353a4cc2505df --- Demo/Riskeer/src/Demo.Riskeer/GUIs/DemoProjectPlugin.cs (.../DemoProjectPlugin.cs) (revision 931a128f3ea23e41af2d46a1744e76290a97178d) +++ Demo/Riskeer/src/Demo.Riskeer/GUIs/DemoProjectPlugin.cs (.../DemoProjectPlugin.cs) (revision c9cd43d7f5600222d0fdbca94ca353a4cc2505df) @@ -29,6 +29,7 @@ using Demo.Riskeer.Properties; using Demo.Riskeer.Ribbons; using Demo.Riskeer.Views; +using Riskeer.Common.Data.AssessmentSection; using ChartResources = Core.Plugins.Chart.Properties.Resources; using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; @@ -72,6 +73,13 @@ Image = Resources.FaultTreeIcon, GetViewName = (v, o) => Resources.General_FaultTree }; + + yield return new ViewInfo + { + Image = Resources.AssemblyResultTotal, + GetViewName = (v, o) => Resources.General_Assembly, + CreateInstance = data => new AssemblyView(data) + }; } } } \ No newline at end of file Index: Demo/Riskeer/src/Demo.Riskeer/Ribbons/RiskeerDemoProjectRibbon.xaml.cs =================================================================== diff -u -rc193020084c1ad396e2f75fec3a2ff2aa2b57ae7 -rc9cd43d7f5600222d0fdbca94ca353a4cc2505df --- Demo/Riskeer/src/Demo.Riskeer/Ribbons/RiskeerDemoProjectRibbon.xaml.cs (.../RiskeerDemoProjectRibbon.xaml.cs) (revision c193020084c1ad396e2f75fec3a2ff2aa2b57ae7) +++ Demo/Riskeer/src/Demo.Riskeer/Ribbons/RiskeerDemoProjectRibbon.xaml.cs (.../RiskeerDemoProjectRibbon.xaml.cs) (revision c9cd43d7f5600222d0fdbca94ca353a4cc2505df) @@ -39,7 +39,8 @@ openThematicMapViewCommand, openChartViewCommand, openStackChartViewCommand, - openPointedTreeGraphViewCommand; + openPointedTreeGraphViewCommand, + openAssemblyViewCommand; public RiskeerDemoProjectRibbon(IProjectOwner projectOwner, IViewCommands viewCommands) { @@ -51,6 +52,7 @@ openThematicMapViewCommand = new OpenThematicalMapViewCommand(viewCommands); openStackChartViewCommand = new OpenStackChartViewCommand(viewCommands); openPointedTreeGraphViewCommand = new OpenPointedTreeGraphViewCommand(viewCommands); + openAssemblyViewCommand = new OpenAssemblyViewCommand(viewCommands); } public Ribbon GetRibbonControl() @@ -92,7 +94,7 @@ private void OpenAssemblyViewButton_OnClick(object sender, RoutedEventArgs e) { - + openAssemblyViewCommand.Execute(); } } } \ No newline at end of file Index: Demo/Riskeer/src/Demo.Riskeer/Views/AssemblyView.Designer.cs =================================================================== diff -u -rfd49a5436bd5aadf30f8ad18d0fc5e28c9e22d2c -rc9cd43d7f5600222d0fdbca94ca353a4cc2505df --- Demo/Riskeer/src/Demo.Riskeer/Views/AssemblyView.Designer.cs (.../AssemblyView.Designer.cs) (revision fd49a5436bd5aadf30f8ad18d0fc5e28c9e22d2c) +++ Demo/Riskeer/src/Demo.Riskeer/Views/AssemblyView.Designer.cs (.../AssemblyView.Designer.cs) (revision c9cd43d7f5600222d0fdbca94ca353a4cc2505df) @@ -51,33 +51,11 @@ /// private void InitializeComponent() { - this.splitContainer = new System.Windows.Forms.SplitContainer(); this.riskeerMapControl = new RiskeerMapControl(); this.dataGridViewControl = new Core.Common.Controls.DataGrid.DataGridViewControl(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); - this.splitContainer.Panel1.SuspendLayout(); - this.splitContainer.Panel2.SuspendLayout(); - this.splitContainer.SuspendLayout(); this.SuspendLayout(); + // - // splitContainer - // - this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer.Enabled = false; - this.splitContainer.Location = new System.Drawing.Point(0, 0); - this.splitContainer.Name = "splitContainer"; - this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer.Panel1 - // - this.splitContainer.Panel1.Controls.Add(this.riskeerMapControl); - // - // splitContainer.Panel2 - // - this.splitContainer.Panel2.Controls.Add(this.dataGridViewControl); - this.splitContainer.Size = new System.Drawing.Size(150, 150); - this.splitContainer.TabIndex = 0; - // // riskeerMapControl // this.riskeerMapControl.Dock = System.Windows.Forms.DockStyle.Fill; @@ -100,19 +78,15 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.splitContainer); this.Name = "AssemblyView"; - this.splitContainer.Panel1.ResumeLayout(false); - this.splitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); - this.splitContainer.ResumeLayout(false); + this.Controls.Add(this.riskeerMapControl); + this.Controls.Add(this.dataGridViewControl); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.SplitContainer splitContainer; private RiskeerMapControl riskeerMapControl; private Core.Common.Controls.DataGrid.DataGridViewControl dataGridViewControl; } Index: Demo/Riskeer/src/Demo.Riskeer/Views/AssemblyView.cs =================================================================== diff -u -rfd49a5436bd5aadf30f8ad18d0fc5e28c9e22d2c -rc9cd43d7f5600222d0fdbca94ca353a4cc2505df --- Demo/Riskeer/src/Demo.Riskeer/Views/AssemblyView.cs (.../AssemblyView.cs) (revision fd49a5436bd5aadf30f8ad18d0fc5e28c9e22d2c) +++ Demo/Riskeer/src/Demo.Riskeer/Views/AssemblyView.cs (.../AssemblyView.cs) (revision c9cd43d7f5600222d0fdbca94ca353a4cc2505df) @@ -20,14 +20,21 @@ // All rights reserved. using System.Windows.Forms; +using Core.Common.Controls.Views; +using Core.Components.Gis.Data; +using Riskeer.Common.Data.AssessmentSection; namespace Demo.Riskeer.Views { - public partial class AssemblyView : UserControl + public partial class AssemblyView : UserControl, IView { - public AssemblyView() + public AssemblyView(BackgroundData backgroundData) { InitializeComponent(); + + riskeerMapControl.SetAllData(new MapDataCollection("test"), backgroundData); } + + public object Data { get; set; } } -} +} \ No newline at end of file