private void ReadSymbolFile(string filename) { int sortOrder = 1; using (XmlInput xmlinput = new XmlInput(filename)) { xmlinput.CheckElement("symbols"); bool first = true; while (xmlinput.FindSubElement(first, new string[] { "symbol", "language" })) { if (xmlinput.Name == "symbol") { Symbol symbol = new Symbol(this, sortOrder); ++sortOrder; symbol.ReadXml(xmlinput); if (symbols.ContainsKey(symbol.Id)) { symbols[symbol.Id].Add(symbol); } else { symbols[symbol.Id] = new List <Symbol>() { symbol }; } } else if (xmlinput.Name == "language") { SymbolLanguage language = new SymbolLanguage(); language.ReadXml(xmlinput); languages.Add(language.LangId, language); } first = false; } } }
private void ReadSymbolFile(string filename) { using (XmlInput xmlinput = new XmlInput(filename)) { xmlinput.CheckElement("symbols"); bool first = true; while (xmlinput.FindSubElement(first, new string[] { "symbol", "language" })) { if (xmlinput.Name == "symbol") { Symbol symbol = new Symbol(this); symbol.ReadXml(xmlinput); symbols.Add(symbol.Id, symbol); } else if (xmlinput.Name == "language") { SymbolLanguage language = new SymbolLanguage(); language.ReadXml(xmlinput); languages.Add(language.LangId, language); } first = false; } } }