コード例 #1
0
        private void BuildTable(MarkdownBuilder mb, IMarkdownItem item, string[] headers, MarkdownMethod mdType)
        {
            mb.AppendLine();

            List <string[]> data = new List <string[]>();


            string[] dataValues = new string[headers.Length];

            Type lookUpType = null;

            if (item.ItemType == MarkdownItemTypes.Method)
            {
                lookUpType = item.As <MarkdownMethod>().ReturnType;
            }

            dataValues[0] = Cleaner.CreateFullTypeWithLinks(mdType, lookUpType, false, false);

            string name = item.FullName;

            if (item.ItemType == MarkdownItemTypes.Method)
            {
                name = Cleaner.CreateFullMethodWithLinks(mdType, item.As <MarkdownMethod>(), false, true, false);
            }
            else if (item.ItemType == MarkdownItemTypes.Property)
            {
                name = Cleaner.CreateFullParameterWithLinks(mdType, item.As <MarkdownProperty>(), false, _options.ShowParameterNames);
            }
            else if (item.ItemType == MarkdownItemTypes.Constructor)
            {
                name = Cleaner.CreateFullConstructorsWithLinks(mdType, item.As <MarkdownConstructor>(), false, _options.BuildConstructorPages);
            }


            dataValues[1] = name;

            data.Add(dataValues);
            mb.Table(headers, data, true);
            mb.AppendLine();
        }
コード例 #2
0
        private void BuildTable(MarkdownBuilder mb, string label, IMarkdownItem[] items, string[] headers, MarkdownType mdType)
        {
            if (items.Any())
            {
                mb.Header(2, label);
                mb.AppendLine();

                var seq = items.OrderBy(x => x.Name);

                List <string[]> data = new List <string[]>();

                foreach (var item in seq)
                {
                    string[] dataValues = new string[headers.Length];


                    Type lookUpType = null;

                    if (item.ItemType == MarkdownItemTypes.Method)
                    {
                        lookUpType = item.As <MarkdownMethod>().ReturnType;
                    }
                    else if (item.ItemType == MarkdownItemTypes.Constructor)
                    {
                        lookUpType = null;
                    }
                    else
                    {
                        lookUpType = item.As <IMarkdownTypePartValue>().Type;
                    }



                    if (item.ItemType == MarkdownItemTypes.Constructor)
                    {
                        dataValues[0] = Cleaner.CreateFullConstructorsWithLinks(mdType, item.As <MarkdownConstructor>(), false, _options.ShowParameterNames);
                    }
                    else
                    {
                        dataValues[0] = Cleaner.CreateFullTypeWithLinks(mdType, lookUpType, false, false);
                    }

                    string name    = item.FullName;
                    string summary = item.Summary;



                    if (item.ItemType == MarkdownItemTypes.Method)
                    {
                        name = Cleaner.CreateFullMethodWithLinks(mdType, item.As <MarkdownMethod>(), false, _options.ShowParameterNames, false);
                    }
                    else if (item.ItemType == MarkdownItemTypes.Property)
                    {
                        name = Cleaner.CreateFullParameterWithLinks(mdType, item.As <MarkdownProperty>(), false, _options.ShowParameterNames);
                    }
                    else if (item.ItemType == MarkdownItemTypes.Constructor)
                    {
                        name = Cleaner.CreateFullConstructorsWithLinks(mdType, item.As <MarkdownConstructor>(), false, _options.BuildConstructorPages);
                    }

                    dataValues[0] = name;

                    if (headers.Length > 1)
                    {
                        dataValues[1] = item.Summary;
                    }

                    data.Add(dataValues);
                }

                mb.Table(headers, data, true);
                mb.AppendLine();
            }
        }