private bool ValidateSettings(string fileName) { try { using (StreamReader sr = new StreamReader(fileName)) { if (sr.Peek() >= 0) { string rawData = sr.ReadToEnd(); m_subSettings = JsonConvert.DeserializeObject <SubscriberNotificationSetting>(rawData); if (m_subSettings != null) { return(true); } } } } catch (Exception e) { Interaction.MsgBox($"Unfortunately, there was an issue loading\n{fileName}. It was most likely not formatted properly. Please use a JSON parser to fix your settings file.\nOnce you have done so please reload this mod and try again."); return(true); } return(false); }
public override void Shutdown() { m_twitchClient = null; m_subSettings = null; }