public override pEngramRange pGetEngramRange() { string name = "Unknown item"; string unit = ""; Boolean inclusionRange = false; List<string> valueList; string condition; string compareTo; pEngramRange returnValue; try { reader.Read(); name = pGetString(); if ("Unit" == reader.Name) unit = pGetString(); if ("Comparison" == reader.Name) { reader.Read();//bypass "Comparison" condition = pGetString(); compareTo = pGetString(); reader.ReadEndElement(); returnValue = new pEngramRange(name, unit, condition, compareTo); } else { if ("Included" == reader.Name) { inclusionRange = true; } //Now get the block with the range values // reader.Read(); // pass the <Inclusion>/<Exclusion> returnValue = new pEngramRange(name, unit, inclusionRange); valueList = pGetStringList(commaRegex); for (int i = 0; i < valueList.Count; i++) returnValue.Add(valueList[i]); // reader.ReadEndElement(); } reader.ReadEndElement(); return returnValue; } catch (SystemException e) { throw new ApplicationException("Error reading EngramRange with name " + name + ": " + e.Message); } }
public override pEngramRange pGetEngramRange() { string name = "Unknown item"; Boolean inclusionRange = false; List<string> valueList; try { reader.Read(); name = pGetString(); if ("Included" == reader.Name) { inclusionRange = true; } //Now get the block with the range values // reader.Read(); // pass the <Inclusion>/<Exclusion> pEngramRange returnValue = new pEngramRange(name, inclusionRange); // while ("Value" == reader.Name) // { // returnValue.Add(pGetString()); valueList = pGetStringList(commaRegex); for (int i = 0; i < valueList.Count; i++) returnValue.Add(valueList[i]); // } // reader.ReadEndElement(); reader.ReadEndElement(); return returnValue; } catch (SystemException e) { throw new ApplicationException("Error reading EngramRange with name " + name + ": " + e.Message); } }