Exemplo n.º 1
0
        void CreateNamespacePage(DocItem Item)
        {
            StringBuilder Content = new StringBuilder();

            AddTopItemHeader(Content, Item);

            List <DocItem> Interfaces = Item.GetInterfaces();
            List <DocItem> Classes    = Item.GetClasses();
            List <DocItem> Enums      = Item.GetEnums();
            List <DocItem> Constants  = Item.GetConstants();
            List <DocItem> Fields     = Item.GetFields();
            List <DocItem> Properties = Item.GetProperties();
            List <DocItem> Functions  = Item.GetFunctions();
            List <DocItem> Callbacks  = Item.GetCallbacks();

            /*
             * Namespace
             * Constants
             * Fields
             * Properties
             * Interfaces (a list of names/links only)
             * Classes (a list of names/links only)
             * Enums (a list of names/links only)
             * Functions
             * Callbacks
             */

            AddConstants(Content, Constants);
            AddFields(Content, Fields);
            AddProperties(Content, Properties);
            AddList(Content, Interfaces, "Interfaces", "Interfaces", "Interface");
            AddList(Content, Classes, "Classes", "Classes", "Class");
            AddList(Content, Enums, "Enums", "Enums", "Enum");
            AddFunctions(Content, Functions);
            AddCallbacks(Content, Callbacks);

            StringBuilder SB = PreparePage(Item.FullName);

            string sContent = PrettyPrint(Content.ToString());

            SB.Replace("__CONTENT__", sContent);

            string sHtml = SB.ToString();

            string PageFileName = Item is DocItemGlobal ? "Global.html" : Item.HRef;
            string FilePath     = Path.Combine(OutputFolder, PageFileName);

            File.WriteAllText(FilePath, sHtml);
        }
Exemplo n.º 2
0
        string Sidebar_GetNamespace(DocItem Item)
        {
            /*
             * Namespace
             * Functions
             * Classes
             * Constants
             * Fields
             * Properties
             * Enums
             * Callbacks
             */

            Dictionary <string, List <DocItem> > Dic = new Dictionary <string, List <DocItem> >()
            {
                { "Functions", Item.GetFunctions() },
                { "Interfaces", Item.GetInterfaces() },
                { "Classes", Item.GetClasses() },
                { "Constants", Item.GetConstants() },
                { "Fields", Item.GetFields() },
                { "Properties", Item.GetProperties() },
                { "Enums", Item.GetEnums() },
                { "Callbacks", Item.GetCallbacks() },
            };


            string NSName = Item is DocItemGlobal ? "Global" : Item.FullName;
            string sLink  = GetLink(Item.HRef, NSName);

            StringBuilder SB        = Sidebar_NewNode(sLink, "Namespace");
            StringBuilder sbContent = new StringBuilder();

            foreach (var Entry in Dic)
            {
                sbContent.AppendLine(Sidebar_GetList(Item, Entry.Value, Entry.Key));
            }

            SB.Replace("__CONTENT__", sbContent.ToString());
            return(SB.ToString());
        }