Exemplo n.º 1
0
        /// <summary>
        /// 反序列化节点集合
        /// </summary>
        /// <param name="dictionary">属性集合</param>
        /// <param name="type">对象类型</param>
        /// <param name="serializer">JS序列化器</param>
        /// <returns>反序列化生成的对象</returns>
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            List <DeluxeTreeNode> rootNode = new List <DeluxeTreeNode>();

            ArrayList nodes = (ArrayList)dictionary["nodes"];
            DeluxeTreeNodeConverter nodeConvert = new DeluxeTreeNodeConverter();

            for (int i = 0; i < nodes.Count; i++)
            {
                rootNode.Add((DeluxeTreeNode)nodeConvert.Deserialize((IDictionary <string, object>)nodes[i], typeof(DeluxeTreeNode), serializer));
            }

            return(rootNode);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 反序列化节点集合
        /// </summary>
        /// <param name="dictionary">属性集合</param>
        /// <param name="type">对象类型</param>
        /// <param name="serializer">JS序列化器</param>
        /// <returns>反序列化生成的对象</returns>
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            List<DeluxeTreeNode> rootNode = new List<DeluxeTreeNode>();

            ArrayList nodes = (ArrayList)dictionary["nodes"];
            DeluxeTreeNodeConverter nodeConvert = new DeluxeTreeNodeConverter();
            for (int i = 0; i < nodes.Count; i++)
                rootNode.Add((DeluxeTreeNode)nodeConvert.Deserialize((IDictionary<string, object>)nodes[i], typeof(DeluxeTreeNode), serializer));

            return rootNode;
        }