Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -rf96e01d46f29a268ab62fc6afe5b23f311e63a39 -rf7cf0aa90e0d435fc03c42790368ad02a0889411 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision f96e01d46f29a268ab62fc6afe5b23f311e63a39) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision f7cf0aa90e0d435fc03c42790368ad02a0889411) @@ -104,12 +104,9 @@ Name = PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, Category = RingtoetsCommonFormsResources.Ringtoets_Category, Image = PipingFormsResources.PipingSurfaceLineIcon, - FileFilter = $"{PipingFormsResources.PipingSurfaceLinesCollection_DisplayName} {RingtoetsCommonFormsResources.DataTypeDisplayName_csv_file_filter}", - IsEnabled = context => context.AssessmentSection.ReferenceLine != null, - CreateFileImporter = (context, filePath) => new PipingSurfaceLinesCsvImporter(context.WrappedData, - context.AssessmentSection.ReferenceLine, - new RingtoetsPipingSurfaceLineReplaceDataStrategy(), - filePath) + FileFilter = RingtoetsPipingSurfaceLineFileFilter, + IsEnabled = IsSurfaceLineImporterEnabled, + CreateFileImporter = (context, filePath) => PipingSurfaceLinesCsvImporter(context, filePath, new RingtoetsPipingSurfaceLineReplaceDataStrategy()) }; yield return new ImportInfo @@ -126,6 +123,16 @@ public override IEnumerable GetUpdateInfos() { + yield return new UpdateInfo + { + Name = PipingFormsResources.PipingSurfaceLinesCollection_DisplayName, + Category = RingtoetsCommonFormsResources.Ringtoets_Category, + Image = PipingFormsResources.PipingSurfaceLineIcon, + FileFilter = new ExpectedFile("csv", "Profielschematisaties Kommagescheiden bestand"), + IsEnabled = IsSurfaceLineImporterEnabled, + CreateFileImporter = (context, filePath) => PipingSurfaceLinesCsvImporter(context, filePath, new RingtoetsPipingSurfaceLineUpdateDataStrategy(context.FailureMechanism)) + }; + yield return new UpdateInfo { Name = PipingFormsResources.StochasticSoilModelCollection_DisplayName, @@ -542,6 +549,7 @@ { return Gui.Get(nodeData, treeViewControl) .AddImportItem() + .AddUpdateItem() .AddSeparator() .AddDeleteChildrenItem() .AddSeparator() @@ -969,5 +977,32 @@ } #endregion + + #region Ringtoets piping surface line importer + + private static PipingSurfaceLinesCsvImporter PipingSurfaceLinesCsvImporter(RingtoetsPipingSurfaceLinesContext context, + string filePath, + ISurfaceLineUpdateSurfaceLineStrategy strategy) + { + return new PipingSurfaceLinesCsvImporter(context.WrappedData, + context.AssessmentSection.ReferenceLine, + filePath, + strategy); + } + + private static bool IsSurfaceLineImporterEnabled(RingtoetsPipingSurfaceLinesContext context) + { + return context.AssessmentSection.ReferenceLine != null; + } + + private static string RingtoetsPipingSurfaceLineFileFilter + { + get + { + return $"{PipingFormsResources.PipingSurfaceLinesCollection_DisplayName} {RingtoetsCommonFormsResources.DataTypeDisplayName_csv_file_filter}"; + } + } + + #endregion } } \ No newline at end of file