/// <summary> /// Reads the configuration file from a stream /// </summary> /// <param name="stream">stream</param> /// <param name="anyChanges"> Whether the config object required an upgrade or had unexpected fields added or missing</param> /// <returns>ConfigFile object</returns> public static ConfigFile Read(Stream stream, out bool anyChanges) { using (var sr = new StreamReader(stream)) { var cf = FileTools.LoadConfigAndCheckForChanges <ConfigFile>(sr.ReadToEnd(), out anyChanges); ConfigRead?.Invoke(cf); return(cf); } }
public static TSConfig Read(Stream stream) { using (var sr = new StreamReader(stream)) { var cf = JsonConvert.DeserializeObject <TSConfig>(sr.ReadToEnd()); ConfigRead?.Invoke(cf); return(cf); } }