Example #1
0
        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();
        }
Example #2
0
        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;
        }
Example #3
0
        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);
        }
Example #4
0
 public Automatr(AutomatrConfig config)
 {
     Config = config;
 }
Example #5
0
 public Automatr(AutomatrConfig config)
 {
     Config = config;
 }