Exemplo n.º 1
0
        private BaseNode DoSPList(Microsoft.SharePoint.Client.List list, BaseNode parentNode, BaseNode rootNode)
        {
            list.EnsureProperties(l => l.RootFolder, l => l.BaseType, l => l.ContentTypes, l => l.Fields);

            ListNode listNode = parentNode as ListNode;

            // Add Content Type Container node
            BaseNode listContentTypeContainerNode = new ContentTypeContainerNode(list.ContentTypes);

            listNode.Children.Add(listContentTypeContainerNode);

            listContentTypeContainerNode.ParentNode    = listNode;
            listContentTypeContainerNode.RootNode      = rootNode;
            listContentTypeContainerNode.NodeConnector = this;

            // Add Field Container node
            BaseNode fieldContainerNode = new FieldContainerNode(list.Fields);

            listNode.Children.Add(fieldContainerNode);
            fieldContainerNode.ParentNode    = listNode;
            fieldContainerNode.RootNode      = rootNode;
            fieldContainerNode.NodeConnector = this;

            // Add immediate children of the root folder
            BaseNode rootFolder = this.DoSPFolder(list.RootFolder, listNode, rootNode, true);

            foreach (var subFolder in rootFolder.Children)
            {
                listNode.Children.Add(subFolder);
            }

            return(listNode);
        }