Files
StructureHelper/StructureHelperCommon/Services/Exports/Factories/FileInputDataFactory.cs
2025-11-01 21:56:47 +05:00

51 lines
1.4 KiB
C#

using StructureHelperCommon.Infrastructures.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Services.Exports.Factories
{
public enum FileInputDataType
{
Csv,
Png,
Dxf
}
public static class FileInputDataFactory
{
public static FileIOInputData GetFileIOInputData(FileInputDataType dataType)
{
if (dataType == FileInputDataType.Csv)
{
return new FileIOInputData
{
Filter = "csv |*.csv",
Title = "Save in csv File"
};
}
else if (dataType == FileInputDataType.Png)
{
return new FileIOInputData
{
Filter = "png |*.png",
Title = "Save in *.png File"
};
}
else if (dataType == FileInputDataType.Dxf)
{
return new FileIOInputData
{
Filter = "dxf |*.dxf",
Title = "Save in *.dxf File"
};
}
else
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(dataType));
}
}
}
}