CSV factoriy hinzugefügt
This commit is contained in:
9
CSVParser/AcceptedCSVFormats.cs
Normal file
9
CSVParser/AcceptedCSVFormats.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace CSVParser
|
||||
{
|
||||
public enum AcceptedCSVFormats
|
||||
{
|
||||
UVRELINING,
|
||||
BLUELIGHT
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,10 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AcceptedCSVFormats.cs" />
|
||||
<Compile Include="BlueLight.cs" />
|
||||
<Compile Include="CSVParser.cs" />
|
||||
<Compile Include="CsvParserFactory.cs" />
|
||||
<Compile Include="UVRelining.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
25
CSVParser/CsvParserFactory.cs
Normal file
25
CSVParser/CsvParserFactory.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SanShared;
|
||||
|
||||
namespace CSVParser
|
||||
{
|
||||
public static class CsvParserFactory
|
||||
{
|
||||
public static IReadCSVData ReadCSVFile(AcceptedCSVFormats csvFormat, string csvFile)
|
||||
{
|
||||
switch (csvFormat)
|
||||
{
|
||||
case AcceptedCSVFormats.UVRELINING:
|
||||
return new UVRelining(csvFile);
|
||||
case AcceptedCSVFormats.BLUELIGHT:
|
||||
return new BlueLight(csvFile);
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(csvFormat));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user