private void WriteCondition(System.Xml.XmlWriter writer, Conditions.SCCondition obj) { writer.WriteStartElement("condition"); writer.WriteStartAttribute("Expression"); writer.WriteValue(obj.Condition); writer.WriteEndAttribute(); writer.WriteStartAttribute("Description"); writer.WriteValue(obj.Description); writer.WriteEndAttribute(); writer.WriteStartAttribute("OwnerID"); writer.WriteValue(obj.OwnerID); writer.WriteEndAttribute(); writer.WriteStartAttribute("SortID"); writer.WriteValue(obj.SortID); writer.WriteEndAttribute(); writer.WriteStartAttribute("Type"); writer.WriteValue(obj.Type); writer.WriteEndAttribute(); writer.WriteStartAttribute("VersionEndTime"); writer.WriteValue(obj.VersionEndTime); writer.WriteEndAttribute(); writer.WriteStartAttribute("VersionStartTime"); writer.WriteValue(obj.VersionStartTime); writer.WriteEndAttribute(); writer.WriteEndElement(); }
private static Conditions.SCCondition LoadCondition(System.Xml.XmlNode xml) { var condition = new Conditions.SCCondition(); condition.Condition = xml.Attributes["Expression"].Value; condition.Description = xml.Attributes["Description"].Value; condition.OwnerID = xml.Attributes["OwnerID"].Value; condition.SortID = System.Xml.XmlConvert.ToInt32(xml.Attributes["SortID"].Value); condition.Type = xml.Attributes["Type"].Value; condition.VersionEndTime = System.Xml.XmlConvert.ToDateTime(xml.Attributes["VersionEndTime"].Value, System.Xml.XmlDateTimeSerializationMode.Local); condition.VersionStartTime = System.Xml.XmlConvert.ToDateTime(xml.Attributes["VersionStartTime"].Value, System.Xml.XmlDateTimeSerializationMode.Local); return(condition); }