예제 #1
0
        /// <summary>
        /// 生成TreeNode
        /// </summary>
        /// <returns></returns>
        private TreeNode ToTreeNode()
        {
            //对象的初始化器直接构造
            TreeNode treeNode = new TreeNode()
            {
                id = this.ID,
                text = this.Name,
                state = "open",
                Checked = false,
                attributes = new {isAticon = this.IsActive },
                children = new List<TreeNode>() // 子节点集合
            };

            return treeNode;
        }
예제 #2
0
        /// <summary>
        /// 生成TreeNode
        /// </summary>
        /// <returns></returns>
        private TreeNode ToTreeNode()
        {
            //对象的初始化器直接构造
            TreeNode treeNode = new TreeNode()
            {
                id = this.ID.ToString(),
                text = this.Name,
                state = "open",
                iconCls= this.ICO,
                Checked = false,
                attributes = new { url = this.GetUrl(this.AreaName, this.ControllerName, this.ActionName)},  //把生成的URL存到
                children = new List<TreeNode>() // 子节点集合
            };

            return treeNode;
        }