Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r026b09ff792545d0093e6d58d7daea0fe3c8269f -r84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 026b09ff792545d0093e6d58d7daea0fe3c8269f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb) @@ -166,6 +166,15 @@ } /// + /// Looks up a localized string similar to Assemblageresultaat verversen. + /// + public static string AssemblyResultTotalView_RefreshAssemblyResultsButton_Text { + get { + return ResourceManager.GetString("AssemblyResultTotalView_RefreshAssemblyResultsButton_Text", resourceCulture); + } + } + + /// /// Looks up a localized string similar to ID van het traject.. /// public static string AssessmentSection_Id_Description { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r026b09ff792545d0093e6d58d7daea0fe3c8269f -r84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 026b09ff792545d0093e6d58d7daea0fe3c8269f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb) @@ -381,4 +381,7 @@ Benaderde faalkans + + Assemblageresultaat verversen + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs =================================================================== diff -u -r57517bf1c8e4d95cdd1d1e871891995c16cf94ea -r84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs (.../AssemblyResultTotalView.Designer.cs) (revision 57517bf1c8e4d95cdd1d1e871891995c16cf94ea) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs (.../AssemblyResultTotalView.Designer.cs) (revision 84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb) @@ -50,31 +50,60 @@ private void InitializeComponent() { this.dataGridViewControl = new Core.Common.Controls.DataGrid.DataGridViewControl(); + this.RefreshAssemblyResultsButton = new System.Windows.Forms.Button(); + this.buttonGroupBox = new System.Windows.Forms.GroupBox(); + this.buttonGroupBox.SuspendLayout(); this.SuspendLayout(); // // dataGridViewControl // this.dataGridViewControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridViewControl.Location = new System.Drawing.Point(0, 0); - this.dataGridViewControl.MultiSelect = false; + this.dataGridViewControl.Location = new System.Drawing.Point(0, 43); + this.dataGridViewControl.MultiSelect = true; this.dataGridViewControl.Name = "dataGridViewControl"; this.dataGridViewControl.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect; - this.dataGridViewControl.Size = new System.Drawing.Size(177, 202); - this.dataGridViewControl.TabIndex = 0; + this.dataGridViewControl.Size = new System.Drawing.Size(789, 373); + this.dataGridViewControl.TabIndex = 3; // - // AssessmentSectionCombinedAssemblyResultView + // RefreshAssemblyResultsButton // + this.RefreshAssemblyResultsButton.AutoSize = true; + this.RefreshAssemblyResultsButton.Location = new System.Drawing.Point(3, 14); + this.RefreshAssemblyResultsButton.Name = "RefreshAssemblyResultsButton"; + this.RefreshAssemblyResultsButton.Size = new System.Drawing.Size(164, 23); + this.RefreshAssemblyResultsButton.TabIndex = 0; + this.RefreshAssemblyResultsButton.UseVisualStyleBackColor = true; + this.RefreshAssemblyResultsButton.Click += new System.EventHandler(this.RefreshAssemblyResults_Click); + // + // buttonGroupBox + // + this.buttonGroupBox.Controls.Add(this.RefreshAssemblyResultsButton); + this.buttonGroupBox.Dock = System.Windows.Forms.DockStyle.Top; + this.buttonGroupBox.Location = new System.Drawing.Point(0, 0); + this.buttonGroupBox.MinimumSize = new System.Drawing.Size(180, 43); + this.buttonGroupBox.Name = "buttonGroupBox"; + this.buttonGroupBox.Size = new System.Drawing.Size(789, 43); + this.buttonGroupBox.TabIndex = 2; + this.buttonGroupBox.TabStop = false; + // + // AssemblyResultTotalView + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.dataGridViewControl); + this.Controls.Add(this.buttonGroupBox); this.Name = "AssemblyResultTotalView"; - this.Size = new System.Drawing.Size(177, 202); + this.Size = new System.Drawing.Size(789, 416); + this.buttonGroupBox.ResumeLayout(false); + this.buttonGroupBox.PerformLayout(); this.ResumeLayout(false); } #endregion private Core.Common.Controls.DataGrid.DataGridViewControl dataGridViewControl; + private System.Windows.Forms.Button RefreshAssemblyResultsButton; + private System.Windows.Forms.GroupBox buttonGroupBox; } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs =================================================================== diff -u -r43ecbec68a9008d7aecbfd98b26947a0d3992ffd -r84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 43ecbec68a9008d7aecbfd98b26947a0d3992ffd) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.Windows.Forms; using Core.Common.Controls.Views; +using Core.Common.Util.Extensions; using Ringtoets.AssemblyTool.Data; using Ringtoets.Integration.Data; using Ringtoets.Integration.Forms.Properties; @@ -55,6 +56,7 @@ AssessmentSection = assessmentSection; InitializeComponent(); + LocalizeControl(); InitializeDataGridView(); } @@ -65,6 +67,11 @@ public object Data { get; set; } + private void LocalizeControl() + { + RefreshAssemblyResultsButton.Text = Resources.AssemblyResultTotalView_RefreshAssemblyResultsButton_Text; + } + private void InitializeDataGridView() { dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRow.Name), @@ -122,5 +129,11 @@ var random = new Random(); return new FailureMechanismAssembly(random.NextDouble(), FailureMechanismAssemblyCategoryGroup.IIIt); } + + private void RefreshAssemblyResults_Click(object sender, EventArgs e) + { + assemblyResultRows.ForEachElementDo(row => row.Update()); + dataGridViewControl.RefreshDataGridView(); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs =================================================================== diff -u -r43ecbec68a9008d7aecbfd98b26947a0d3992ffd -r84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision 43ecbec68a9008d7aecbfd98b26947a0d3992ffd) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision 84a764ce59a1d2f2083cf7ebc4303da4f1cdccfb) @@ -93,8 +93,12 @@ testForm.Show(); // Assert - Assert.AreEqual(1, view.Controls.Count); + Assert.AreEqual(2, view.Controls.Count); + var button = (Button) new ControlTester("RefreshAssemblyResultsButton").TheObject; + Assert.AreEqual("Assemblageresultaat verversen", button.Text); + Assert.IsTrue(button.Enabled); + Assert.IsInstanceOf(view); Assert.IsInstanceOf(view); Assert.IsNull(view.Data); @@ -211,6 +215,36 @@ } } + [Test] + public void GivenAssemblyResultTotalView_WhenUpdateCalled_ThenDataGridViewInvalidated() + { + // Given + var random = new Random(21); + var assessmentSection = new AssessmentSection(random.NextEnumValue()); + + // Then + using (var view = new AssemblyResultTotalView(assessmentSection)) + { + testForm.Controls.Add(view); + testForm.Show(); + + var invalidated = false; + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + dataGridView.Invalidated += (sender, args) => invalidated = true; + + // Precondition + Assert.IsFalse(invalidated); + + var buttonTester = new ButtonTester("RefreshAssemblyResultsButton", testForm); + + // When + buttonTester.Click(); + + // Then + Assert.IsTrue(invalidated); + } + } + private static void AssertAssemblyRow(IFailureMechanism failureMechanism, DataGridViewCellCollection row) { Assert.AreEqual(expectedColumnCount, row.Count);