Пример #1
0
        void CreateClassPage(DocItem Item)
        {
            StringBuilder Content = new StringBuilder();

            AddTopItemHeader(Content, Item);

            DocItem        Constructor = Item.GetConstructor();
            List <DocItem> Constants   = Item.GetConstants();
            List <DocItem> Fields      = Item.GetFields();
            List <DocItem> Properties  = Item.GetProperties();
            List <DocItem> Functions   = Item.GetFunctions();

            //List<DocItem> Classes = Item.GetClasses().Cast<DocItem>().ToList();
            //List<DocItem> EventArgs = Item.GetEventArgs().Cast<DocItem>().ToList();
            //List<DocItem> Enums = Item.GetEnums().Cast<DocItem>().ToList();

            /*
             * Class
             *  Constructor
             *  Constants
             *  Fields
             *  Properties
             *  Functions
             *  Events
             *
             */

            if (!Item.IsStatic)
            {
                AddConstructor(Content, Constructor);
            }
            AddConstants(Content, Constants);
            AddFields(Content, Fields);
            AddProperties(Content, Properties);
            AddFunctions(Content, Functions);
            AddEvents(Content, Item.Events);


            StringBuilder SB = PreparePage(Item.FullName);

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

            SB.Replace("__CONTENT__", sContent);

            string sHtml = SB.ToString();

            string PageFileName = Item.FullName + ".html";
            string FilePath     = Path.Combine(OutputFolder, PageFileName);

            File.WriteAllText(FilePath, sHtml);
        }
Пример #2
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);
        }
Пример #3
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());
        }