CsvFileSerializer and RefSerializer are now back in the .Api project. CSV, TXT and CHL files can now be loaded and edited like any other supported channel list.

Eleminated redundant code that was used for loading/applying reference lists in CSV or TXT/CHL format.
This commit is contained in:
hbeham
2016-05-05 03:06:11 +02:00
parent 7b7e7bef99
commit 0a71f34639
10 changed files with 1420 additions and 1183 deletions

View File

@@ -0,0 +1,20 @@
using System.IO;
namespace ChanSort.Api
{
public class RefSerializerPlugin : ISerializerPlugin
{
public string PluginName => "ChanSort Reference List";
public string FileFilter => "*.txt;*.chl;*.csv";
public SerializerBase CreateSerializer(string inputFile)
{
var ext = (Path.GetExtension(inputFile) ?? "").ToLower();
if (ext == ".csv")
return new CsvFileSerializer(inputFile);
else
return new RefSerializer(inputFile);
}
}
}