ImageLoadFileEntryFactory
using Castle.Windsor;
using kCura.WinEDDS;
using Relativity.Logging;
using System;
namespace Relativity.DataExchange.Export.VolumeManagerV2.Metadata.Images.Lines
{
public class ImageLoadFileEntryFactory
{
private readonly ILog _logger;
public ImageLoadFileEntryFactory(ILog logger)
{
_logger = logger;
}
public IImageLoadFileEntry Create(ExportFile exportSettings, IWindsorContainer container)
{
LoadFileType.FileFormat? logFileFormat = exportSettings.LogFileFormat;
LoadFileType.FileFormat fileFormat = LoadFileType.FileFormat.Opticon;
if ((logFileFormat.GetValueOrDefault() == fileFormat) & logFileFormat.HasValue)
return container.Resolve<OpticonLoadFileEntry>();
logFileFormat = exportSettings.LogFileFormat;
fileFormat = LoadFileType.FileFormat.IPRO;
if (!((logFileFormat.GetValueOrDefault() == fileFormat) & logFileFormat.HasValue)) {
logFileFormat = exportSettings.LogFileFormat;
fileFormat = LoadFileType.FileFormat.IPRO_FullText;
if (!((logFileFormat.GetValueOrDefault() == fileFormat) & logFileFormat.HasValue)) {
_logger.LogError("Unknown image load file format {type}. Cannot create load file entry builder.", new object[1] {
exportSettings.LogFileFormat
});
throw new ArgumentException($"""{exportSettings.LogFileFormat}""");
}
}
return container.Resolve<IproLoadFileEntry>();
}
}
}