Ejemplo n.º 1
0
        /// <summary>
        /// 从序列化的Xml文档中还原对象
        /// </summary>
        public XmlPackage(XmlDocument xmlDoc)
        {
            XmlNodeReader reader = new XmlNodeReader(xmlDoc.DocumentElement);
            XmlSerializer ser    = new XmlSerializer(typeof(XmlPackage));
            XmlPackage    pkg    = (XmlPackage)ser.Deserialize(reader);

            this.SetPackageDictionary(pkg.GetPackageDictionary());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 从序列化的数据中还原对象
        /// </summary>
        public XmlPackage(byte[] binData)
        {
            XmlPackage pkg = (XmlPackage)GetDeserializeObject(binData);

            this.SetPackageDictionary(pkg.GetPackageDictionary());
        }