private void writeDesignSteelSummary(XmlWriter xml) { xml.WriteStartElement("T-Design_Steel_Summary"); for (int i = 0; i < results.DesignSteelSummary.Length; i++) { SteelDesignSummary res = results.DesignSteelSummary[i]; if (!string.IsNullOrEmpty(res.Status) && res.DesignData != null) { xml.WriteStartElement("Data"); xml.WriteAttributeString("Case", results.ActiveCase.Id.ToString()); xml.WriteAttributeString("id", i.ToString()); xml.WriteAttributeString("data", string.Join(",", res.DesignData)); xml.WriteAttributeString("error", res.ErrMsg); xml.WriteAttributeString("ratio", res.Ratio.ToString()); xml.WriteAttributeString("status", res.Status); xml.WriteAttributeString("warning", res.WarnMsg); xml.WriteEndElement(); } } xml.WriteEndElement(); }
private void readDesignSteelSummary(XmlNode xml) { if (xml != null && xml.ChildNodes.Count > 0) { foreach (XmlNode child in xml.ChildNodes) { if ("Data".Equals(child.Name)) { int rCase = int.Parse(Deserializer.readAttribute(child, "Case")); int i = int.Parse(Deserializer.readAttribute(child, "id", results.ActiveCase.Name)); results.ActiveCase = results.ResultsCases[rCase]; SteelDesignSummary res = results.DesignSteelSummary[i]; res.DesignData = Deserializer.readAttribute(child, "data").Split(comma); res.ErrMsg = Deserializer.readAttribute(child, "error", res.ErrMsg); res.Ratio = float.Parse(Deserializer.readAttribute(child, "ratio", res.Ratio.ToString())); res.Status = Deserializer.readAttribute(child, "status", res.Status); res.WarnMsg = Deserializer.readAttribute(child, "warning", res.WarnMsg); } } } }