Beispiel #1
0
        internal static TreeNode[] GetChildren(DirectoryNode node, object innerDoc)
        {
            var children = new List <AbstractTreeNode>();

            var entries = node.Entries;

            while (entries.MoveNext())
            {
                EntryNode        entry = entries.Current as EntryNode;
                AbstractTreeNode treeNode;
                if (entry is DirectoryNode)
                {
                    treeNode = new DirectoryTreeNode(entry as DirectoryNode);

                    var o = entry as DirectoryNode;
                }
                else
                {
                    var o = entry as DocumentNode;

                    treeNode = new DocumentTreeNode(entry as DocumentNode);

                    #region handle Excel BIFF records

                    if (treeNode.Text.ToLower() == "workbook")
                    {
                        HandleWorkbook(treeNode, (HSSFWorkbook)innerDoc);
                    }
                    //else if(treeNode.Text.ToLower() == "worddocument")
                    //{
                    //    HandleWord(treeNode, (HWPFDocument)innerDoc);
                    //}

                    #endregion
                }

                children.Add(treeNode);
            }

            children.Sort();

            return(children.ToArray());
        }
Beispiel #2
0
        internal static TreeNode[] GetChildren(DirectoryNode node,object innerDoc)
        {
            var children = new List<AbstractTreeNode>();

            var entries = node.Entries;

            while (entries.MoveNext())
            {
                EntryNode entry = entries.Current as EntryNode;
                AbstractTreeNode treeNode;
                if (entry is DirectoryNode)
                {
                    treeNode = new DirectoryTreeNode(entry as DirectoryNode);

                    var o = entry as DirectoryNode;
                }
                else
                {
                    var o = entry as DocumentNode;

                    treeNode = new DocumentTreeNode(entry as DocumentNode);

                    #region handle Excel BIFF records

                    if (treeNode.Text.ToLower() == "workbook")
                    {
                        HandleWorkbook(treeNode, (HSSFWorkbook)innerDoc);
                    }
                    //else if(treeNode.Text.ToLower() == "worddocument")
                    //{
                    //    HandleWord(treeNode, (HWPFDocument)innerDoc);
                    //}

                    #endregion
                }

                children.Add(treeNode);
            }

            children.Sort();

            return children.ToArray();
        }