static void Main(string[] args) { AppDomain.CurrentDomain.ProcessExit += OnExitEventHandler; Console.CancelKeyPress += OnCancelKeyPressedEventHandler; if (args.Count() > 0 && args[0] == "--config") { Configuration.GetConfiguration(); Configuration.ConfigurationDialog(); isclean = true; return; } else { failedComponents = ((Dictionary <string, object>)PersistentData.LoadPersistentData()[0]).ToDictionary(x => x.Key, x => x.Value.ToString()); trackedIncidents = ((Dictionary <string, object>)PersistentData.LoadPersistentData()[1]).ToDictionary(x => x.Key, x => x.Value.ToString()); hostFailCount = ((Dictionary <string, object>)PersistentData.LoadPersistentData()[2]).ToDictionary(x => x.Key, x => Convert.ToInt32(x.Value)); while (true && !stopping) { CheckHosts(); for (int i = 0; i <= Configuration.GetConfiguration().Interval&& !stopping; i++) { Thread.Sleep(1000); } } isclean = true; } }