Exemplo n.º 1
0
        public void Text_property_is_converted_to_CompositeSpan_when_required_05()
        {
            var paragraph = new MdParagraph();

            paragraph.Add("Text");
            paragraph.Add("Text");

            var expected = new MdCompositeSpan(new MdTextSpan("Text"), new MdTextSpan("Text"));

            Assert.True(expected.DeepEquals(paragraph.Text));
        }
Exemplo n.º 2
0
        protected void AddDeclaringTypeSection(MdContainerBlock block)
        {
            var paragraph = new MdParagraph(
                new MdStrongEmphasisSpan("Declaring Type:"), " ", GetMdSpan(Model.TypeDocumentation.TypeId),
                "\r\n",
                new MdStrongEmphasisSpan("Namespace:"), " ", GetMdSpan(Model.TypeDocumentation.NamespaceDocumentation.NamespaceId),
                "\r\n",
                new MdStrongEmphasisSpan("Assembly:"), " " + Model.AssemblyDocumentation.Name
                );

            if (m_Configuration.Template.Default.IncludeVersion)
            {
                paragraph.Add("\r\n");
                paragraph.Add(new MdCompositeSpan(
                                  new MdStrongEmphasisSpan("Assembly Version:"), " " + Model.AssemblyDocumentation.Version)
                              );
            }

            block.Add(paragraph);
        }
Exemplo n.º 3
0
        private void AddDefinitionSection(MdContainerBlock block)
        {
            var infoParagraph = new MdParagraph();

            block.Add(infoParagraph);

            // Add declaring type if the type is a nested type
            if (Model.IsNestedType)
            {
                infoParagraph.Add(new MdCompositeSpan(new MdStrongEmphasisSpan("Declaring Type:"), " ", GetMdSpan(Model.DeclaringType !.TypeId)));
                infoParagraph.Add("\r\n");
            }

            // add namespace and assembly names
            infoParagraph.Add(new MdCompositeSpan(new MdStrongEmphasisSpan("Namespace:"), " ", GetMdSpan(Model.NamespaceDocumentation.NamespaceId)));
            infoParagraph.Add("\r\n");
            infoParagraph.Add(new MdCompositeSpan(new MdStrongEmphasisSpan("Assembly:"), " " + Model.GetAssemblyDocumentation().Name));

            // add assembly version
            if (m_Configuration.Template.Default.IncludeVersion)
            {
                infoParagraph.Add("\r\n");
                infoParagraph.Add(new MdCompositeSpan(new MdStrongEmphasisSpan("Assembly Version:"), " " + Model.GetAssemblyDocumentation().Version));
            }

            if (!Model.Summary.IsEmpty)
            {
                block.Add(ConvertToBlock(Model.Summary));
            }

            // Definition as code
            block.Add(new MdCodeBlock(Model.CSharpDefinition, "csharp"));

            // Add list of base types
            if (Model.InheritanceHierarchy.Count > 1)
            {
                block.Add(
                    new MdParagraph(
                        new MdStrongEmphasisSpan("Inheritance:"),
                        " ",
                        Model.InheritanceHierarchy.Select(GetMdSpan).Join(" → ")
                        ));
            }

            // Add class attributes
            if (Model.Attributes.Count > 0)
            {
                block.Add(
                    new MdParagraph(
                        new MdStrongEmphasisSpan("Attributes:"),
                        " ",
                        Model.Attributes.Select(GetMdSpan).Join(",")
                        ));
            }

            // Add list of implemented interfaces
            if (Model.ImplementedInterfaces.Count > 0)
            {
                block.Add(
                    new MdParagraph(
                        new MdStrongEmphasisSpan("Implements:"),
                        " ",
                        Model.ImplementedInterfaces.Select(GetMdSpan).Join(","))
                    );
            }
        }