public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("Wall"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); int counter = 0; foreach (WallType wallTypeItem in Level.Building.WallTypeList) { if (ReferenceEquals(wallTypeItem, WallType)) { XMLOperations.AddAttribute(xmlNode, xmlDocument, "WallTypeNumber", Convert.ToString(counter)); } counter++; } XMLOperations.AddAttribute(xmlNode, xmlDocument, "ReWriteHeight", Convert.ToString(ReWriteHeight)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Height", Convert.ToString(Height)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ConcreteStartOffset", Convert.ToString(ConcreteStartOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ConcreteEndOffset", Convert.ToString(ConcreteEndOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ReiforcementStartOffset", Convert.ToString(ReiforcementStartOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "ReiforcementEndOffset", Convert.ToString(ReiforcementEndOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "OverrideVertSpacing", Convert.ToString(OverrideVertSpacing)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "OverrideHorSpacing", Convert.ToString(OverrideHorSpacing)); XmlElement StartPointNode = StartPoint.SaveToXMLNode(xmlDocument, "StartPoint"); xmlNode.AppendChild(StartPointNode); XmlElement EndPointNode = EndPoint.SaveToXMLNode(xmlDocument, "EndPoint"); xmlNode.AppendChild(EndPointNode); foreach (OpeningPlacing obj in OpeningPlacingList) { xmlNode.AppendChild(obj.SaveToXMLNode(xmlDocument)); } XmlElement VertSpacingSettingNode = VertSpacingSetting.SaveToXMLNode(xmlDocument, "VertSpacingSetting"); xmlNode.AppendChild(VertSpacingSettingNode); XmlElement HorSpacingSettingNode = HorSpacingSetting.SaveToXMLNode(xmlDocument, "HorSpacingSetting"); xmlNode.AppendChild(HorSpacingSettingNode); return(xmlNode); }
public XmlElement SaveToXMLNode(XmlDocument xmlDocument) { XmlElement xmlNode = xmlDocument.CreateElement("WallType"); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Name", Name); XMLOperations.AddAttribute(xmlNode, xmlDocument, "Thickness", Convert.ToString(Thickness)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "TopOffset", Convert.ToString(TopOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "BottomOffset", Convert.ToString(BottomOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "BarTopOffset", Convert.ToString(BarTopOffset)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "RoundVertToBaseLength", Convert.ToString(RoundVertToBaseLength)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "VertBaseLength", Convert.ToString(VertBaseLength)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "HorLapping", Convert.ToString(HorLapping)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "HorLappingLength", Convert.ToString(HorLappingLength)); XMLOperations.AddAttribute(xmlNode, xmlDocument, "HorBaseLength", Convert.ToString(HorBaseLength)); XmlElement VertSpacingSettingNode = VertSpacingSetting.SaveToXMLNode(xmlDocument, "VertSpacingSetting"); xmlNode.AppendChild(VertSpacingSettingNode); XmlElement HorSpacingSettingNode = HorSpacingSetting.SaveToXMLNode(xmlDocument, "HorSpacingSetting"); xmlNode.AppendChild(HorSpacingSettingNode); return(xmlNode); }