private static LogLevelSettings Restore(string file) { using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(file))) { using (var reader = XmlReader.Create(stream)) { reader.MoveToContent(); var settings = new LogLevelSettings(); settings.Restore(reader); return(settings); } } }