53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Linq;
|
|
using YamlDotNet.Serialization.NamingConventions;
|
|
using YamlDotNet.Serialization;
|
|
using System.Reflection.Metadata;
|
|
|
|
namespace MapoDataFiller
|
|
{
|
|
public class MConf
|
|
{
|
|
public string ConfDir { get; set; } = "";
|
|
public string CodIOB { get; set; } = "";
|
|
public bool HasHeader { get; set; } = false;
|
|
public string TimeTable { get; set; } = "";
|
|
public string OutFolder { get; set; } = "";
|
|
|
|
public MConf()
|
|
{
|
|
ConfDir = @"C:\Temp\Interclays\";
|
|
CodIOB = "NONE";
|
|
HasHeader = false;
|
|
TimeTable = "Demo.csv";
|
|
OutFolder = @"C:\Temp\Interclays\Out";
|
|
}
|
|
}
|
|
public class CMan
|
|
{
|
|
/// <summary>
|
|
/// Deserializza dato filePath
|
|
/// </summary>
|
|
/// <param name="filePath"></param>
|
|
public static MConf readConf(string filePath)
|
|
{
|
|
MConf retObj = new MConf();
|
|
if (File.Exists(filePath))
|
|
{
|
|
var deserializer = new DeserializerBuilder()
|
|
.WithNamingConvention(new PascalCaseNamingConvention())
|
|
.Build();
|
|
string rawData = File.ReadAllText(filePath);
|
|
|
|
var input = new StringReader(rawData);
|
|
retObj = deserializer.Deserialize<MConf>(input);
|
|
}
|
|
return retObj;
|
|
}
|
|
}
|
|
}
|