Exemplo n.º 1
0
        public APIIndex(List<DoxygenModule> InModules)
            : base(null, "API")
        {
            // Build a mapping of module names to modules
            Dictionary<string, DoxygenModule> NameToModuleMap = new Dictionary<string,DoxygenModule>();
            foreach(DoxygenModule Module in InModules)
            {
                NameToModuleMap.Add(Module.Name, Module);
            }

            // Create a module category tree
            APIModuleCategory RootCategory = new APIModuleCategory(null);
            RootCategory.AddModules(InModules.Select(x => new KeyValuePair<string, string>(x.Name, x.BaseSrcDir)).ToArray());
            Debug.Assert(RootCategory.MinorModules.Count == 0 && RootCategory.MajorModules.Count == 0);

            // Create all the index pages
            foreach (APIModuleCategory Category in RootCategory.Categories)
            {
                if (!Category.IsEmpty)
                {
                    APIModuleIndex ModuleIndex = new APIModuleIndex(this, Category, InModules);
                    ModuleIndexes.Add(ModuleIndex);
                }
            }
            Pages.AddRange(ModuleIndexes);

            // Get all the members that were created as part of building the modules. After this point we'll only create index pages.
            List<APIMember> AllMembers = new List<APIMember>(GatherPages().OfType<APIMember>().OrderBy(x => x.FullName));
            foreach (APIMember Member in AllMembers)
            {
                Member.Link();
            }
            foreach (APIMember Member in AllMembers)
            {
                Member.PostLink();
            }

            // Create an index of all the constants
            ConstantIndex = new APIConstantIndex(this, AllMembers);
            Pages.Add(ConstantIndex);

            // Create an index of all the functions
            FunctionIndex = new APIFunctionIndex(this, AllMembers.OfType<APIFunction>().Where(x => !(x.ScopeParent is APIRecord)));
            Pages.Add(FunctionIndex);

            // Create an index of all the types
            TypeIndex = new APITypeIndex(this, AllMembers);
            Pages.Add(TypeIndex);

            // Create an index of all the classes
            RecordHierarchy = APIHierarchy.Build(this, AllMembers.OfType<APIRecord>());
            Pages.Add(RecordHierarchy);

            // Create all the quick links
            foreach (string QuickLinkPath in QuickLinkPaths)
            {
                APIMember Member = AllMembers.FirstOrDefault(x => x.LinkPath == QuickLinkPath);
                if (Member != null) QuickLinks.Add(Member);
            }
        }
Exemplo n.º 2
0
        public APIIndex(List <DoxygenModule> InModules)
            : base(null, "API")
        {
            // Build a mapping of module names to modules
            Dictionary <string, DoxygenModule> NameToModuleMap = new Dictionary <string, DoxygenModule>();

            foreach (DoxygenModule Module in InModules)
            {
                NameToModuleMap.Add(Module.Name, Module);
            }

            // Add some default categories to fix the order
            APIModuleCategory RootCategory = new APIModuleCategory("Modules");

            RootCategory.Categories.Add(new APIModuleCategory("Runtime"));
            RootCategory.Categories.Add(new APIModuleCategory("Editor"));
            RootCategory.Categories.Add(new APIModuleCategory("Developer"));
            RootCategory.Categories.Add(new APIModuleCategory("Plugins"));

            // Add all of the modules to a category
            Dictionary <DoxygenModule, APIModuleCategory> ModuleToCategory = new Dictionary <DoxygenModule, APIModuleCategory>();

            foreach (DoxygenModule Module in InModules)
            {
                APIModuleCategory Category = FindRootCategoryByPath(RootCategory.Categories, Module.BaseSrcDir);
                ModuleToCategory.Add(Module, Category);
            }

            // Create all the index pages
            foreach (APIModuleCategory Category in RootCategory.Categories)
            {
                APIModuleIndex ChildModuleIndex = new APIModuleIndex(this, Category);
                ChildModuleIndexes.Add(ChildModuleIndex);
            }
            Pages.AddRange(ChildModuleIndexes);

            // Populate all the categories and create all the module pages
            foreach (KeyValuePair <DoxygenModule, APIModuleCategory> Pair in ModuleToCategory)
            {
                APIModuleIndex Parent = ChildModuleIndexes.First(x => x.Category == Pair.Value);

                APIModule Module = APIModule.Build(Parent, Pair.Key);
                Parent.Children.Add(Module);

                Pair.Value.Modules.Add(Module);
//				Pair.Value.AddModule(Module);
            }

            // Expand the Core section by default
            APIModuleCategory DefaultCategory = RootCategory.Categories[0].Categories.FirstOrDefault(x => x.Name == "Core Runtime Modules");

            if (DefaultCategory != null)
            {
                DefaultCategory.Expanded = true;
            }

            // Get all the members that were created as part of building the modules. After this point we'll only create index pages.
            List <APIMember> AllMembers = new List <APIMember>(GatherPages().OfType <APIMember>().OrderBy(x => x.FullName));

            foreach (APIMember Member in AllMembers)
            {
                Member.Link();
            }
            foreach (APIMember Member in AllMembers)
            {
                Member.PostLink();
            }

            // Create the quick start page
            GettingStarted = new APIGettingStarted(this);
            Pages.Add(GettingStarted);

            // Create an index of all the constants
            ConstantIndex = new APIConstantIndex(this, AllMembers);
            Pages.Add(ConstantIndex);

            // Create an index of all the functions
            FunctionIndex = new APIFunctionIndex(this, AllMembers.OfType <APIFunction>().Where(x => !(x.ScopeParent is APIRecord)));
            Pages.Add(FunctionIndex);

            // Create an index of all the enums
            EnumIndex = new APIEnumIndex(this, AllMembers);
            Pages.Add(EnumIndex);

            // Create an index of all the records
            RecordIndex = new APIRecordIndex(this, AllMembers);
            Pages.Add(RecordIndex);

            // Create an index of all the classes
            RecordHierarchy = APIHierarchy.Build(this, AllMembers.OfType <APIRecord>());
            Pages.Add(RecordHierarchy);
        }
Exemplo n.º 3
0
		public APIIndex(List<DoxygenModule> InModules)
			: base(null, "API")
		{
			// Build a mapping of module names to modules
			Dictionary<string, DoxygenModule> NameToModuleMap = new Dictionary<string,DoxygenModule>();
			foreach(DoxygenModule Module in InModules)
			{
				NameToModuleMap.Add(Module.Name, Module);
			}

			// Add some default categories to fix the order
			APIModuleCategory RootCategory = new APIModuleCategory("Modules");
			RootCategory.Categories.Add(new APIModuleCategory("Runtime"));
			RootCategory.Categories.Add(new APIModuleCategory("Editor"));
			RootCategory.Categories.Add(new APIModuleCategory("Developer"));
			RootCategory.Categories.Add(new APIModuleCategory("Plugins"));

			// Add all of the modules to a category
			Dictionary<DoxygenModule, APIModuleCategory> ModuleToCategory = new Dictionary<DoxygenModule, APIModuleCategory>();
			foreach(DoxygenModule Module in InModules)
			{
				APIModuleCategory Category = FindRootCategoryByPath(RootCategory.Categories, Module.BaseSrcDir);
				ModuleToCategory.Add(Module, Category);
			}

			// Create all the index pages
			foreach (APIModuleCategory Category in RootCategory.Categories)
			{
				APIModuleIndex ChildModuleIndex = new APIModuleIndex(this, Category);
				ChildModuleIndexes.Add(ChildModuleIndex);
			}
			Pages.AddRange(ChildModuleIndexes);

			// Populate all the categories and create all the module pages
			foreach(KeyValuePair<DoxygenModule, APIModuleCategory> Pair in ModuleToCategory)
			{
				APIModuleIndex Parent = ChildModuleIndexes.First(x => x.Category == Pair.Value);

				APIModule Module = APIModule.Build(Parent, Pair.Key);
				Parent.Children.Add(Module);

				Pair.Value.Modules.Add(Module);
//				Pair.Value.AddModule(Module);
			}

			// Expand the Core section by default
			APIModuleCategory DefaultCategory = RootCategory.Categories[0].Categories.FirstOrDefault(x => x.Name == "Core Runtime Modules");
			if (DefaultCategory != null) DefaultCategory.Expanded = true;

			// Get all the members that were created as part of building the modules. After this point we'll only create index pages.
			List<APIMember> AllMembers = new List<APIMember>(GatherPages().OfType<APIMember>().OrderBy(x => x.FullName));
			foreach (APIMember Member in AllMembers)
			{
				Member.Link();
			}
			foreach (APIMember Member in AllMembers)
			{
				Member.PostLink();
			}

			// Create the quick start page
			GettingStarted = new APIGettingStarted(this);
			Pages.Add(GettingStarted);

			// Create an index of all the constants
			ConstantIndex = new APIConstantIndex(this, AllMembers);
			Pages.Add(ConstantIndex);

			// Create an index of all the functions
			FunctionIndex = new APIFunctionIndex(this, AllMembers.OfType<APIFunction>().Where(x => !(x.ScopeParent is APIRecord)));
			Pages.Add(FunctionIndex);

			// Create an index of all the enums
			EnumIndex = new APIEnumIndex(this, AllMembers);
			Pages.Add(EnumIndex);

			// Create an index of all the records
			RecordIndex = new APIRecordIndex(this, AllMembers);
			Pages.Add(RecordIndex);

			// Create an index of all the classes
			RecordHierarchy = APIHierarchy.Build(this, AllMembers.OfType<APIRecord>());
			Pages.Add(RecordHierarchy);
		}