public static async Task <IIniDocument> ParseAsync(TextReader reader) { IniDocument document = new IniDocument(); bool readHeader = true; while (reader.Peek() > 0) { string line = await reader.ReadLineAsync(); if (string.IsNullOrWhiteSpace(line)) { continue; } if (line.TrimStart()[0].Equals('[')) { readHeader = false; } if (readHeader) { document.Head.Put(IniKeyValuePairUtils.Parse(line)); } else { document.Put(await IniSectionUtils.ParseAsync(reader, line)); } } return(document); }