Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of <see cref="StructuresImporter{TCollection}"/>.
        /// </summary>
        /// <param name="importTarget">The import target.</param>
        /// <param name="referenceLine">The reference line used to check if the imported structures are intersecting it.</param>
        /// <param name="filePath">The path to the file to import from.</param>
        /// <param name="messageProvider">The message provider to provide messages during importer actions.</param>
        /// <param name="structureUpdateStrategy">The strategy to update the imported data.</param>
        /// <exception cref="ArgumentNullException">Thrown when any of the input parameters is <c>null</c>.</exception>
        protected StructuresImporter(StructureCollection <TStructure> importTarget,
                                     ReferenceLine referenceLine,
                                     string filePath,
                                     IImporterMessageProvider messageProvider,
                                     IStructureUpdateStrategy <TStructure> structureUpdateStrategy)
            : base(filePath, importTarget)
        {
            if (referenceLine == null)
            {
                throw new ArgumentNullException(nameof(referenceLine));
            }

            if (structureUpdateStrategy == null)
            {
                throw new ArgumentNullException(nameof(structureUpdateStrategy));
            }

            if (messageProvider == null)
            {
                throw new ArgumentNullException(nameof(messageProvider));
            }

            this.referenceLine           = referenceLine;
            this.messageProvider         = messageProvider;
            this.structureUpdateStrategy = structureUpdateStrategy;
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new instance of <see cref="ClosingStructuresImporter"/>.
 /// </summary>
 /// <param name="importTarget">The closing structures to import on.</param>
 /// <param name="referenceLine">The reference line used to check if the <see cref="ClosingStructure"/>
 /// objects found in the file are intersecting it.</param>
 /// <param name="filePath">The path to the file to import from.</param>
 /// <param name="messageProvider">The message provider to provide messages during importer actions.</param>
 /// <param name="updateStrategy">The strategy to update the structures with imported data.</param>
 /// <exception cref="ArgumentNullException">Thrown when any of the input parameters is <c>null</c>.</exception>
 public ClosingStructuresImporter(StructureCollection <ClosingStructure> importTarget,
                                  ReferenceLine referenceLine,
                                  string filePath,
                                  IImporterMessageProvider messageProvider,
                                  IStructureUpdateStrategy <ClosingStructure> updateStrategy)
     : base(importTarget, referenceLine, filePath, messageProvider, updateStrategy)
 {
 }
Esempio n. 3
0
 public TestStructuresImporter(StructureCollection <TestStructure> importTarget,
                               ReferenceLine referenceLine,
                               string filePath,
                               IStructureUpdateStrategy <TestStructure> structureUpdateStrategy,
                               IImporterMessageProvider messageProvider)
     : base(importTarget, referenceLine, filePath, messageProvider, structureUpdateStrategy)
 {
 }
Esempio n. 4
0
 private static IFileImporter CreateClosingStructuresImporter(ClosingStructuresContext context,
                                                              string filePath,
                                                              IImporterMessageProvider importerMessageProvider,
                                                              IStructureUpdateStrategy <ClosingStructure> structureUpdateStrategy)
 {
     return(new ClosingStructuresImporter(context.WrappedData,
                                          context.AssessmentSection.ReferenceLine,
                                          filePath,
                                          importerMessageProvider,
                                          structureUpdateStrategy));
 }