示例#1
0
 public void WriteToXmlNode(IXmlCodeWriter writer, XmlNode node)
 {
     if (ItemArray != null)
     {
         XmlNode ns = XmlUtil.CreateSingleNewElement(node, XML_Values);
         ns.RemoveAll();
         for (int i = 0; i < ItemArray.Length; i++)
         {
             XmlNode nd = node.OwnerDocument.CreateElement(WebPageDataSet.XML_Item);
             ns.AppendChild(nd);
             writer.WriteValue(nd, ItemArray[i], null);
         }
     }
 }
示例#2
0
        public override void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node)
        {
            XmlUtil.SetAttribute(node, XmlTags.XMLATT_ClassID, ClassId);
            XmlUtil.SetAttribute(node, XmlTags.XMLATT_ComponentID, MemberId);
            XmlNode pn = node.OwnerDocument.CreateElement(XML_Location);

            node.AppendChild(pn);
            writer.WriteValue(pn, this.Location, null);
            //
            if (_label != null)
            {
                XmlSerialization.WriteValueToChildNode(node, XML_RelativePosition, _label.RelativePosition.Location);
                XmlNode nd = node.SelectSingleNode(XML_RelativePosition);
                XmlSerialization.SetAttribute(nd, "xTo0", _label.RelativePosition.IsXto0);
                XmlSerialization.SetAttribute(nd, "yTo0", _label.RelativePosition.IsYto0);
            }
        }
示例#3
0
 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));
                    }
                }
            }
        }
示例#5
0
        public WriteResult WriteToXmlNode(XmlNode parentXmlNode, IXmlCodeWriter writer)
        {
            _xmlNode = parentXmlNode.SelectSingleNode(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                                    "{0}[@{1}='{2}']",
                                                                    TreeViewX.XML_Value, TreeViewX.XMLATT_Name, _data.Name));
            if (_xmlNode == null)
            {
                _xmlNode = parentXmlNode.OwnerDocument.CreateElement(TreeViewX.XML_Value);
                parentXmlNode.AppendChild(_xmlNode);
                XmlUtil.SetAttribute(_xmlNode, TreeViewX.XMLATT_Name, _data.Name);
            }

            XmlUtil.SetLibTypeAttribute(_xmlNode, _data.Value.ValueType);
            if (_data.Value.Value == null || _data.Value.Value == DBNull.Value)
            {
                return(WriteResult.WriteOK);
            }
            else
            {
                return(writer.WriteValue(_xmlNode, _data.Value.Value, null));
            }
        }
 public void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node)
 {
     XmlUtil.SetAttribute(node, XMLATT_colWidth, _conditionWidth);
     XmlUtil.SetAttribute(node, XMLATT_col2Width, _actionWidth);
     XmlUtil.SetAttribute(node, XMLATT_width, _editorSize.Width);
     XmlUtil.SetAttribute(node, XMLATT_height, _editorSize.Height);
     if (_decisionTable != null)
     {
         for (int i = 0; i < _decisionTable.Count; i++)
         {
             XmlNode item = node.OwnerDocument.CreateElement(XmlTags.XML_Item);
             node.AppendChild(item);
             XmlNode nodeCOndition = XmlUtil.CreateSingleNewElement(item, XML_Condition);
             writer.WriteValue(nodeCOndition, _decisionTable[i].Condition, null);
             if (_decisionTable[i].Actions != null)
             {
                 XmlNode nodeActions = XmlUtil.CreateSingleNewElement(item, XmlTags.XML_ACTIONS);
                 _decisionTable[i].Actions.OnWriteToXmlNode((XmlObjectWriter)writer, nodeActions);
             }
         }
     }
 }
 public void OnWriteToXmlNode(IXmlCodeWriter serializer, XmlNode node)
 {
     if (_properties != null)
     {
         XmlNode items = XmlUtil.CreateSingleNewElement(node, XmlTags.XML_Data);
         items.RemoveAll();
         foreach (TypedNamedValue nv in _properties.Values)
         {
             XmlNode nd = node.OwnerDocument.CreateElement(XmlTags.XML_Item);
             items.AppendChild(nd);
             XmlUtil.SetNameAttribute(nd, nv.Name);
             XmlUtil.SetLibTypeAttribute(nd, nv.Value.ValueType);
             XmlNode d = node.OwnerDocument.CreateElement(XmlTags.XML_Data);
             nd.AppendChild(d);
             serializer.WriteValue(d, nv.Value.Value, null);
         }
     }
     if (_phpIncludes != null)
     {
         XmlNode items = XmlUtil.CreateSingleNewElement(node, XmlTags.XML_External);
         items.RemoveAll();
         for (int i = 0; i < _phpIncludes.Count; i++)
         {
             string s = _phpIncludes[i];
             if (s != null)
             {
                 s = s.Trim();
                 if (s.Length > 0)
                 {
                     XmlNode nd = node.OwnerDocument.CreateElement(XmlTags.XML_Item);
                     items.AppendChild(nd);
                     XmlUtil.SetNameAttribute(nd, s);
                 }
             }
         }
     }
 }