Exemple #1
0
        /// <summary>
        /// 用指定节点名称序列化整个 DataList。
        /// </summary>
        /// <param name="node">用于序列化 DataList 的 XmlNode 节点。</param>
        public override void XMLEncode(XmlNode node)
        {
            base.XMLEncode(node);
            XmlNode xmlNode = DataPacket.NewXmlChildNode(node, "FDataList");
            int     count   = this.Count;

            if (count > 0)
            {
                DataPacket   items        = this.GetItems(0);
                XmlAttribute xmlAttribute = xmlNode.OwnerDocument.CreateAttribute("ItemType");
                xmlAttribute.Value = CommUtils.GetObjectTypeName(items);
                xmlNode.Attributes.SetNamedItem(xmlAttribute);
            }
            for (int i = 0; i < count; i++)
            {
                DataPacket items = this.GetItems(i);
                items.XMLEncode(DataPacket.NewXmlChildNode(xmlNode, items.GetTypeName().Replace("`", "_")));
            }
        }
Exemple #2
0
        /// <summary>
        /// 从Xml节点读出属性值, byte[] 类型
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mc"></param>
        /// <param name="Value"></param>
        public static void ReadXmlAttrValue(XmlNode node, string mc, ref byte[] Value)
        {
            string str = ReadXmlAttribStr(node, mc);

            Value = CommUtils.StrToArraybyte(str);
        }