コード例 #1
0
        public static TOCBranch GetFromDocument(EMDocument linkedDocument, int startLevel, int endLevel)
        {
            var root = new TOCBranch();

            linkedDocument.Data.ForEachWithContext(
                new TOCTreeBuildingContext(
                    (header, includesStack) =>
            {
                var level = header.GetLevelWithOffsets(includesStack);

                if (level >= startLevel && level <= endLevel)
                {
                    root.Add(level, header.Text, "#" + header.UniqueKey);
                }
            }));

            root.DeleteNonRootVirtualBranches();

            return(root);
        }
コード例 #2
0
ファイル: EMTOCInline.cs プロジェクト: xiangyuan/Unreal4
        public static TOCBranch GetFromDocument(EMDocument linkedDocument, int startLevel, int endLevel)
        {
            var root = new TOCBranch();

            linkedDocument.Data.ForEachWithContext(
                new TOCTreeBuildingContext(
                    (header, includesStack) =>
                    {
                        var level = header.GetLevelWithOffsets(includesStack);

                        if(level >= startLevel && level <= endLevel)
                        {
                            root.Add(level, header.Text, "#" + header.UniqueKey);
                        }
                    }));

            root.DeleteNonRootVirtualBranches();

            return root;
        }
コード例 #3
0
 private TOCBranch GetTOCTree(int startLevel, int endLevel)
 {
     return(TOCBranch.GetFromDocument(linkedDocument, startLevel, endLevel));
 }