Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionProvider.cs
===================================================================
diff -u -r61dc09c91989d5a593858f8939530e7e929ecbf8 -r2ac63d31605f35e43d3d786173bfbae4c1b46c45
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionProvider.cs (.../AssessmentSectionProvider.cs) (revision 61dc09c91989d5a593858f8939530e7e929ecbf8)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionProvider.cs (.../AssessmentSectionProvider.cs) (revision 2ac63d31605f35e43d3d786173bfbae4c1b46c45)
@@ -19,8 +19,14 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.Collections.Generic;
+using System.Windows.Forms;
+using Core.Common.Gui.Forms.ProgressDialog;
using Ringtoets.Integration.Data;
+using Ringtoets.Integration.Data.Merge;
+using Ringtoets.Integration.Service.Merge;
+using Ringtoets.Storage.Core;
namespace Ringtoets.Integration.Plugin.Merge
{
@@ -29,9 +35,44 @@
///
public class AssessmentSectionProvider : IAssessmentSectionProvider
{
+ private readonly IWin32Window viewParent;
+ private readonly AssessmentSectionsOwner assessmentSectionsOwner;
+
+ ///
+ /// Initializes a new instance of .
+ ///
+ /// The parent of the view.
+ /// Thrown when
+ /// is null.
+ public AssessmentSectionProvider(IWin32Window viewParent)
+ {
+ if (viewParent == null)
+ {
+ throw new ArgumentNullException(nameof(viewParent));
+ }
+
+ this.viewParent = viewParent;
+ assessmentSectionsOwner = new AssessmentSectionsOwner();
+ }
+
public IEnumerable GetAssessmentSections(string filePath)
{
- throw new System.NotImplementedException();
+ if (filePath == null)
+ {
+ throw new ArgumentNullException(nameof(filePath));
+ }
+
+ ActivityProgressDialogRunner.Run(viewParent,
+ LoadAssessmentSectionsActivityFactory.CreateLoadAssessmentSectionsActivity(
+ assessmentSectionsOwner, new LoadAssessmentSectionService(new StorageSqLite()),
+ filePath));
+
+ if (assessmentSectionsOwner.AssessmentSections == null)
+ {
+ throw new AssessmentSectionProviderException();
+ }
+
+ return assessmentSectionsOwner.AssessmentSections;
}
}
}
\ No newline at end of file