private void LoadAutoCompleteFromResultFile(string fileName, STAGE_TYPE type, AutoCompleteData data) { try { XmlTextReader xtr = new XmlTextReader(fileName); while (xtr.Read()) { if (xtr.NodeType == XmlNodeType.Element) { if (xtr.LocalName.ToLower() == StringUtil.XML.Test) { for (int i = 0; i < xtr.AttributeCount; i++) { xtr.MoveToAttribute(i); if (xtr.Name.ToLower() == StringUtil.XML.Suite) { data.InsertWord(xtr.Value, type, true); } else if (xtr.Name.ToLower() == StringUtil.XML.Name) { data.InsertWord(xtr.Value, type, false); } } } xtr.Read(); } } xtr.Close(); } catch (Exception e) { } }
private void LoadAutoCompleteFromACFile(AutoCompleteData data) { try { XmlTextReader xtr = new XmlTextReader(StringUtil.File.UniteTestToolAC); while (xtr.Read()) { if (xtr.LocalName.ToLower() == StringUtil.XML.Stage1) { while (xtr.Read()) { if (xtr.Name == StringUtil.XML.Suite) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_1, true); } else if (xtr.Name == StringUtil.XML.Test) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_1, false); } } } else if (xtr.LocalName.ToLower() == StringUtil.XML.Stage2) { while (xtr.Read()) { if (xtr.Name == StringUtil.XML.Suite) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_2, true); } else if (xtr.Name == StringUtil.XML.Test) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_2, false); } } } else if (xtr.LocalName.ToLower() == StringUtil.XML.Stage3) { while (xtr.Read()) { if (xtr.Name == StringUtil.XML.Suite) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_3, true); } else if (xtr.Name == StringUtil.XML.Test) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_3, false); } } } else if (xtr.LocalName.ToLower() == StringUtil.XML.DB) { while (xtr.Read()) { if (xtr.Name == StringUtil.XML.Suite) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_DB, true); } else if (xtr.Name == StringUtil.XML.Test) { xtr.MoveToFirstAttribute(); data.InsertWord(xtr.Value, STAGE_TYPE.ST_DB, false); } } } } xtr.Close(); } catch (Exception e) { } }