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); } }
internal static void Check(RecoveryConfig recoveryConfig) { var v = new Validator(recoveryConfig); v.DoCheck(); }
public Validator(RecoveryConfig recoveryConfig) { this.m_owner = recoveryConfig; }