public static Load ( string path ) : |
||
path | string | |
return |
public static AutomatrConfig Load(string path)
{
XmlSerializer serializer = new XmlSerializer(typeof(AutomatrConfig));
AutomatrConfig result = null;
try
{
using (StreamReader reader = new StreamReader(path))
{
result = (AutomatrConfig)serializer.Deserialize(reader);
}
AutomatrLog.Log("Loaded config " + path, AutomatrLog.LogLevel.Verbose);
}
catch
{
result = new AutomatrConfig();
}
return result;
}
public static void Main(string[] args) { Options = new AutomatrOptions(); Parser parser = new Parser(new Action <ParserSettings>((ParserSettings p) => { p.CaseSensitive = false; p.IgnoreUnknownArguments = false; p.MutuallyExclusive = true; })); bool parse = parser.ParseArguments(args, Options); if (Options.Version) { AutomatrLog.Log("Automatr " + Version, AutomatrLog.LogLevel.Info); return; } AutomatrConfig config = AutomatrConfig.Load(Options.ConfigPath); Automatr automatr = new Automatr(config); automatr.Run(); }