/// <summary> /// 写入属性 /// </summary> /// <param name="writer">XML写入对象</param> /// <param name="node">XAribute对象</param> public static void WriteXAribute(XmlTextWriter writer, XAribute node) { writer.WriteStartElement("XAribute"); writer.WriteAttributeString("ID", node.Id.ToString()); writer.WriteAttributeString("Title", node.Title); writer.WriteAttributeString("PointTypeitem", node.SelectType.ToString()); writer.WriteAttributeString("ListTypeitem", node.SelectSpc.ToString()); writer.WriteAttributeString("PositionTypeitem", node.SelectPositionStyle.ToString()); writer.WriteAttributeString("LinkTypeitem", node.CanLinkNum.ToString()); writer.WriteAttributeString("TipTypeitem", node.Hint); writer.WriteAttributeString("LastExTexteitem", node.ExName); writer.WriteAttributeString("OpenType", node.MyOpenType.ToString()); if (ISXAributeToSaveValue(node)) { writer.WriteElementString("Value", node.GetValueTextBox()); } /// 关闭XAribute元素节点 writer.WriteEndElement(); }
/// <summary> /// 更新属性节点 /// </summary> /// <param name="update">可以创建节点的域</param> /// <param name="xaributefather">属性的父节点</param> /// <param name="node">属性内容</param> public static void UpdateXAribute(XmlDocument update, XmlElement xaributefather, XAribute node) { XmlElement xaribute = update.CreateElement("XAribute"); xaribute.SetAttribute("ID", node.Id.ToString()); xaribute.SetAttribute("Title", node.Title); xaribute.SetAttribute("PointTypeitem", node.SelectType.ToString()); xaribute.SetAttribute("ListTypeitem", node.SelectSpc.ToString()); xaribute.SetAttribute("PositionTypeitem", node.SelectPositionStyle.ToString()); xaribute.SetAttribute("LinkTypeitem", node.CanLinkNum.ToString()); xaribute.SetAttribute("TipTypeitem", node.Hint); xaribute.SetAttribute("LastExTexteitem", node.ExName); xaribute.SetAttribute("OpenType", node.MyOpenType.ToString()); if (ISXAributeToSaveValue(node)) { xaribute.SetAttribute("Value", node.GetValueTextBox()); } xaributefather.AppendChild(xaribute); }