private void readDesignConcreteBeam(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 = results.ResultsCases[rCase]; ConcreteBeamDesign res = results.DesignConcreteBeam[i]; res.DesignData = Deserializer.readAttribute(child, "data").Split(comma); res.ErrMsg = Deserializer.readAttribute(child, "error", res.ErrMsg); res.Status = Deserializer.readAttribute(child, "status", res.Status); res.WarnMsg = Deserializer.readAttribute(child, "warning", res.WarnMsg); res.FBotArea = float.Parse(Deserializer.readAttribute(child, "fbotarea")); res.FTopArea = float.Parse(Deserializer.readAttribute(child, "ftoparea")); res.VRebar = float.Parse(Deserializer.readAttribute(child, "vrebar")); } } } }
private void writeDesignConcreteBeam(XmlWriter xml) { xml.WriteStartElement("T-Design_Concrete_Beam"); for (int i = 0; i < results.DesignConcreteBeam.Length; i++) { ConcreteBeamDesign res = results.DesignConcreteBeam[i]; if (res.FBotArea > 0) { xml.WriteStartElement("Data"); xml.WriteAttributeString("Case", results.ActiveCase.Id.ToString()); xml.WriteAttributeString("id", i.ToString()); xml.WriteAttributeString("data", (res.DesignData == null) ? "" : string.Join(",", res.DesignData)); xml.WriteAttributeString("error", res.ErrMsg); xml.WriteAttributeString("fbotarea", res.FBotArea.ToString()); xml.WriteAttributeString("ftoparea", res.FTopArea.ToString()); xml.WriteAttributeString("vrebar", res.VRebar.ToString()); xml.WriteAttributeString("status", res.Status); xml.WriteAttributeString("warning", res.WarnMsg); xml.WriteEndElement(); } } xml.WriteEndElement(); }