public virtual WriteResult WriteToXmlNode(XmlNode parentXmlNode, IXmlCodeWriter writer) { //create XmlNode GenerateXmlNode(parentXmlNode); //write properties WriteResult ret = writer.WriteObjectToNode(_xmlNode, this); //write sub-nodes,shortcuts and values if (this.NextLevelLoaded) { foreach (TreeNode tn in Nodes) { TreeNodeX tnx = tn as TreeNodeX; if (tnx != null) { if (tnx.WriteToXmlNode(_xmlNode, writer) == WriteResult.WriteFail) { ret = WriteResult.WriteFail; } } else { TreeNodeValue tnv = tn as TreeNodeValue; if (tnv != null) { if (tnv.WriteToXmlNode(_xmlNode, writer) == WriteResult.WriteFail) { ret = WriteResult.WriteFail; } } } } } return(ret); }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { XmlUtil.SetNameAttribute(node, Name); XmlNode valNode = XmlUtil.CreateSingleNewElement(node, XmlTags.XML_Object); serializer.WriteObjectToNode(valNode, Value); }
public void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node) { if (_methodPointer != null) { writer.WriteObjectToNode(node, _methodPointer); } XmlUtil.SetAttribute(node, XmlTags.XMLATT_NodeId, ID); }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { if (this.Columns != null && this.Columns.Count > 0) { XmlNode nd = XmlUtil.CreateSingleNewElement(node, XML_Columns); serializer.WriteObjectToNode(nd, this.Columns); } }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { if (_value != null) { XmlNode data = XmlUtil.CreateSingleNewElement(node, XmlTags.XML_Data); serializer.WriteObjectToNode(data, _value); } }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { if (_dataTransfers != null) { foreach (KeyValuePair <IProperty, ParameterValue> kv in _dataTransfers) { XmlNode item = node.OwnerDocument.CreateElement(XmlTags.XML_Item); node.AppendChild(item); XmlNode pNode = node.OwnerDocument.CreateElement(XmlTags.XML_PROPERTY); item.AppendChild(pNode); serializer.WriteObjectToNode(pNode, kv.Key); XmlNode vNode = node.OwnerDocument.CreateElement(XmlTags.XML_Data); item.AppendChild(vNode); serializer.WriteObjectToNode(vNode, kv.Value); } } }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { if (_action != null) { _action.ActionId = 0; XmlNode actNode = XmlUtil.CreateSingleNewElement(node, XmlTags.XML_ACTION); serializer.WriteObjectToNode(actNode, _action); } }
public void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node) { if (_valuePointer != null) { XmlNode nd = node.OwnerDocument.CreateElement(XmlTags.XML_PROPERTY); node.AppendChild(nd); writer.WriteObjectToNode(nd, _valuePointer); } }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { for (int i = 0; i < this.Count; i++) { XmlNode itemNode = node.OwnerDocument.CreateElement(XmlTags.XML_Item); node.AppendChild(itemNode); serializer.WriteObjectToNode(itemNode, this[i]); } }
public override void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node) { base.OnWriteToXmlNode(writer, node); if (!DoNotSaveData) { XmlNode dataNode = node.SelectSingleNode(XmlTags.XML_Var); if (dataNode == null) { dataNode = node.OwnerDocument.CreateElement(XmlTags.XML_Var); node.AppendChild(dataNode); } writer.WriteObjectToNode(dataNode, ClassPointer); } }
public void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node) { XmlNode epNode = node.SelectSingleNode(XML_EventPointer); if (epNode == null) { epNode = node.OwnerDocument.CreateElement(XML_EventPointer); node.AppendChild(epNode); } else { epNode.RemoveAll(); } XmlUtil.SetAttribute(node, XMLATT_firerId, MemberId); writer.WriteObjectToNode(epNode, _event, false); }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { if (_properties != null) { for (int i = 0; i < _properties.Count; i++) { XmlNode xn = node.OwnerDocument.CreateElement(XmlTags.XML_Item); node.AppendChild(xn); XmlUtil.SetNameAttribute(xn, _properties[i].Name); XmlUtil.SetLibTypeAttribute(xn, _properties[i].Value.ValueType); XmlNode xd = node.OwnerDocument.CreateElement(XmlTags.XML_Data); xn.AppendChild(xd); serializer.WriteObjectToNode(xd, _properties[i].Value.Value); } } }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { if (_properties != null) { foreach (KeyValuePair <string, PropertyValueLinker> kv in _properties) { if (kv.Value.Linker != null) { XmlNode itemNode = node.OwnerDocument.CreateElement(XML_Item); node.AppendChild(itemNode); XmlAttribute xa = node.OwnerDocument.CreateAttribute(XMLATT_name); itemNode.Attributes.Append(xa); xa.Value = kv.Key; serializer.WriteObjectToNode(itemNode, kv.Value.Linker); } } } }
protected virtual void OnWrite(IXmlCodeWriter writer, XmlNode dataNode) { if (_type != null) { writer.WriteObjectToNode(dataNode, _type, true); if (_type.IsPrimitive) { LocalVariable v = this.LocalPointer; if (v != null) { if (v.ObjectInstance != null) { XmlNode nd = XmlUtil.CreateSingleNewElement(dataNode, "Value"); writer.WriteValue(nd, v.ObjectInstance, null); } } } } }
public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node) { serializer.WriteValue(node, _instanceType, null); XmlNode dataNode = node.OwnerDocument.CreateElement(XML_Data); node.AppendChild(dataNode); PropertyDescriptorCollection ps = GetProperties(); foreach (PropertyDescriptor p in ps) { if (string.CompareOrdinal(p.Name, "InstanceType") != 0) { if (!p.IsReadOnly) { XmlNode nd = node.OwnerDocument.CreateElement(p.Name); dataNode.AppendChild(nd); serializer.WriteObjectToNode(nd, p.GetValue(this)); } } } }