Beispiel #1
0
    /// <summary>
    /// Binds the folders.
    /// </summary>
    /// <param name="root">The root.</param>
    /// <param name="folderId">The folder id.</param>
    private void BindFolders(JsonTreeNode root, int folderId)
    {
        using (IDataReader reader = FileTreeItem.LoadItemByFolderId(folderId))
        {
            while (reader.Read())
            {
                if ((bool)reader["IsFolder"])
                {
                    string       nodeId = MakeNodeId("folder-" + reader["PageId"].ToString());
                    JsonTreeNode node   = JsonTreeNode.CreateNode(nodeId, reader["PageId"].ToString(), (string)reader["Name"], "Content", "Folder-List", String.Format("folderid={0}&siteid={1}", reader["PageId"].ToString(), SiteId.ToString()), TreeListType.Folders.ToString());

                    if (root.children == null)
                    {
                        root.children = new List <JsonTreeNode>();
                    }

                    root.children.Add(node);
                    BindFolders(node, (int)reader["PageId"]);
                }
            }
            reader.Close();
        }
    }