Exemplo n.º 1
0
        private void LoadConfigFromFile()
        {
            string cfgPath = null;

            try
            {
                JavaScriptSerializer ser = new JavaScriptSerializer();
                cfgPath = GetConfigFile();
                PrintInfo("Reading Configuration File :" + cfgPath);
                var fi  = new FileInfo(cfgPath);
                var cfg = RecoveryConfig.Parse(fi);
                cfg.Validate();
                m_config = cfg;
                ApplyLogs(cfg.Logs);

                // Just print the json
                var username = m_user.Name;
                PrintInfo($"[{username}] Watchdog will be started with: {Environment.NewLine}{cfg}");
            }
            catch (IOException e)
            {
                var name = cfgPath ?? configFileName;
                throw new Exception("Invalid format on: " + name, e);
            }
        }
Exemplo n.º 2
0
            internal static void Check(RecoveryConfig recoveryConfig)
            {
                var v = new Validator(recoveryConfig);

                v.DoCheck();
            }
Exemplo n.º 3
0
 public Validator(RecoveryConfig recoveryConfig)
 {
     this.m_owner = recoveryConfig;
 }