/// <summary> /// /// </summary> /// <param name="node_"></param> public override void Save(XmlNode node_) { base.Save(node_); node_.AddAttribute("functionID", GetFunction().Id.ToString()); }
/// <summary> /// /// </summary> /// <param name="node_"></param> protected override void SaveValue(XmlNode node_) { node_.AddAttribute("varName", m_Value.Name); }
/// <summary> /// /// </summary> /// <param name="node_"></param> public override void Save(XmlNode node_) { base.Save(node_); node_.AddAttribute("ScriptElementID", GetScriptElement().ID.ToString()); }
/// <summary> /// /// </summary> /// <param name="seqNodeNode_"></param> public virtual void Save(XmlNode seqNodeNode_) { const int version = 1; seqNodeNode_.AddAttribute("version", version.ToString()); seqNodeNode_.AddAttribute("comment", Comment); seqNodeNode_.AddAttribute("id", Id.ToString()); string typeName = GetType().AssemblyQualifiedName; int index = typeName.IndexOf(',', typeName.IndexOf(',') + 1); typeName = typeName.Substring(0, index); seqNodeNode_.AddAttribute("type", typeName); //Save slots foreach (NodeSlot slot in m_Slots) { XmlNode nodeSlot = seqNodeNode_.OwnerDocument.CreateElement("Slot"); seqNodeNode_.AppendChild(nodeSlot); slot.Save(nodeSlot); } }
private static IEnumerable<XmlNode> BuildTree(XmlReader xmlReader, int level) { while (xmlReader.Read() ) { if (xmlReader.NodeType == XmlNodeType.EndElement) yield break; var node = new XmlNode { NodeType = xmlReader.NodeType, Name = xmlReader.Name, NamespaceURI = xmlReader.NamespaceURI ?? "", Value = xmlReader.Value, Level = level, IsEmpty = xmlReader.IsEmptyElement }; if (node.NodeType == XmlNodeType.Element || node.NodeType == XmlNodeType.DocumentType) { int attributeCount = xmlReader.AttributeCount; for (int i = 0; i < attributeCount; i++) { xmlReader.MoveToAttribute(i); var attribute = new XmlAttribute { Name = xmlReader.Name, Value = xmlReader.Value }; node.AddAttribute(attribute); } if (node.NodeType == XmlNodeType.Element) { if (!node.IsEmpty) { foreach (XmlNode childNode in BuildTree(xmlReader, level + 1)) { node.AddChild(childNode); } } } } yield return node; } }
/// <summary> /// /// </summary> /// <param name="node_"></param> public override void Save(XmlNode node_) { base.Save(node_); node_.AddAttribute("saveValue", m_SaveValue.ToString()); if (m_SaveValue == true) { m_Value.Save(node_); } }
/// <summary> /// /// </summary> /// <param name="node_"></param> public virtual void Save(XmlNode node_) { const int version = 1; node_.AddAttribute("version", version.ToString()); node_.AddAttribute("index", ID.ToString()); }