private static void Main(string[] args) { IRCClientConsole client = new IRCClientConsole(); client.StartInputThread(); ShareXIRCSettings settings = null; try { do { RestartRequested = false; settings = SettingsBase.Load<ShareXIRCSettings>("Settings.json"); IRCBot bot = new IRCBot(client, settings); bot.Start(); } while (RestartRequested); } finally { if (settings != null) { settings.Save(); } } }
private static void Main(string[] args) { IRCInfo info; if (File.Exists(DefaultSettingsPath)) { info = Settings.Load<IRCInfo>(DefaultSettingsPath); } else { info = new IRCInfo(); } IRCClientConsole client = new IRCClientConsole(info); IRCBot bot = new IRCBot(client); bot.Start(); Settings.Save(info, DefaultSettingsPath); }
private static void Main(string[] args) { IRCInfo info; if (File.Exists(DefaultSettingsPath)) { info = Settings.Load <IRCInfo>(DefaultSettingsPath); } else { info = new IRCInfo(); } IRCClientConsole client = new IRCClientConsole(info); IRCBot bot = new IRCBot(client); bot.Start(); Settings.Save(info, DefaultSettingsPath); }