public void createDataGridFromXml(DataGridView gridView, string sXmlContent) { string sTemp; XMLTagInfo info; XmlReader reader = XmlReader.Create(new StringReader(sXmlContent)); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Text: sTemp = (reader.Value).Replace(".xml", ""); info = new XMLTagInfo(sTemp, false); xmlTagInfoList.Add(info); break; case XmlNodeType.Comment: sTemp = (reader.Value).Replace(".xml", ""); sTemp = sTemp.Replace("<file>", ""); sTemp = sTemp.Replace("</file>", ""); info = new XMLTagInfo(sTemp, true); xmlTagInfoList.Add(info); break; case XmlNodeType.XmlDeclaration: sXmlVersion = reader.Value; break; } } PopilateGridView(gridView, 0); }
public int AddFileTagsToList(List <XMLTagInfo> tagInfo) { Random rand = new Random(); int randNumOftags = rand.Next(100); string randName; XMLTagInfo info; for (int i = 0; i < randNumOftags; ++i) { randName = generateName(); info = new XMLTagInfo(randName, false); tagInfo.Add(info); } return(randNumOftags); }