/// <summary>Parses common features of AbstractComponents (ie field, component, subcomponent) </summary> private void parseAbstractComponentData(AbstractComponent comp, System.Xml.XmlElement elem) { comp.Name = elem.GetAttribute("Name"); comp.Usage = elem.GetAttribute("Usage"); comp.Datatype = elem.GetAttribute("Datatype"); System.String length = elem.GetAttribute("Length"); if (length != null && length.Length > 0) { try { comp.Length = System.Int64.Parse(length); } catch (System.FormatException e) { throw new NuGenProfileException("Length must be a long integer: " + length, e); } } comp.ConstantValue = elem.GetAttribute("ConstantValue"); System.String table = elem.GetAttribute("Table"); if (table != null && table.Length > 0) { try { comp.Table = table; } catch (System.FormatException e) { throw new NuGenProfileException("Table must be a short integer: " + table, e); } } comp.ImpNote = getValueOfFirstElement("ImpNote", elem); comp.Description = getValueOfFirstElement("Description", elem); comp.Reference = getValueOfFirstElement("Reference", elem); comp.Predicate = getValueOfFirstElement("Predicate", elem); int dataValIndex = 0; System.Xml.XmlNodeList children = elem.ChildNodes; for (int i = 0; i < children.Count; i++) { System.Xml.XmlNode n = children.Item(i); if (System.Convert.ToInt16(n.NodeType) == (short)System.Xml.XmlNodeType.Element) { System.Xml.XmlElement child = (System.Xml.XmlElement)n; if (child.Name.ToUpper().Equals("DataValues".ToUpper())) { DataValue val = new DataValue(); val.ExValue = child.GetAttribute("ExValue"); comp.setDataValues(dataValIndex++, val); } } } }
/// <summary>Parses common features of AbstractComponents (ie field, component, subcomponent) </summary> private void parseAbstractComponentData(AbstractComponent comp, System.Xml.XmlElement elem) { comp.Name = elem.GetAttribute("Name"); comp.Usage = elem.GetAttribute("Usage"); comp.Datatype = elem.GetAttribute("Datatype"); System.String length = elem.GetAttribute("Length"); if (length != null && length.Length > 0) { try { comp.Length = System.Int64.Parse(length); } catch (System.FormatException e) { throw new NuGenProfileException("Length must be a long integer: " + length, e); } } comp.ConstantValue = elem.GetAttribute("ConstantValue"); System.String table = elem.GetAttribute("Table"); if (table != null && table.Length > 0) { try { comp.Table = table; } catch (System.FormatException e) { throw new NuGenProfileException("Table must be a short integer: " + table, e); } } comp.ImpNote = getValueOfFirstElement("ImpNote", elem); comp.Description = getValueOfFirstElement("Description", elem); comp.Reference = getValueOfFirstElement("Reference", elem); comp.Predicate = getValueOfFirstElement("Predicate", elem); int dataValIndex = 0; System.Xml.XmlNodeList children = elem.ChildNodes; for (int i = 0; i < children.Count; i++) { System.Xml.XmlNode n = children.Item(i); if (System.Convert.ToInt16(n.NodeType) == (short) System.Xml.XmlNodeType.Element) { System.Xml.XmlElement child = (System.Xml.XmlElement) n; if (child.Name.ToUpper().Equals("DataValues".ToUpper())) { DataValue val = new DataValue(); val.ExValue = child.GetAttribute("ExValue"); comp.setDataValues(dataValIndex++, val); } } } }