public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, "Namespace");

            writer.Write(this, Documentation.GetSummary());

            writer.Write("### Remarks", Documentation.GetRemarks(), this);

            if (writer.NestedTypeVisibility == NestedTypeVisibility.Namespace ||
                writer.NestedTypeVisibility == NestedTypeVisibility.Everywhere)
            {
                writer.WriteChildrenLink <ClassDocItem>("Classes");
                writer.WriteChildrenLink <StructDocItem>("Structs");
                writer.WriteChildrenLink <InterfaceDocItem>("Interfaces");
                writer.WriteChildrenLink <EnumDocItem>("Enums");
                writer.WriteChildrenLink <DelegateDocItem>("Delegates");
            }
            else
            {
                writer.WriteDirectChildrenLink <ClassDocItem>("Classes");
                writer.WriteDirectChildrenLink <StructDocItem>("Structs");
                writer.WriteDirectChildrenLink <InterfaceDocItem>("Interfaces");
                writer.WriteDirectChildrenLink <EnumDocItem>("Enums");
                writer.WriteDirectChildrenLink <DelegateDocItem>("Delegates");
            }
        }
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, Type.Kind.ToString());

            writer.Write(this, Documentation.GetSummary());

            writer.WriteLine("```csharp");
            writer.WriteLine(CodeAmbience.ConvertSymbol(Type));
            writer.WriteLine("```");

            // attribute

            writer.WriteDocItems(TypeParameters, "#### Type parameters");
            writer.WriteDocItems(Parameters, "#### Parameters");

            if (InvokeMethod.ReturnType.Kind != TypeKind.Void)
            {
                writer.WriteLine("#### Returns");
                writer.WriteLine(writer.GetTypeLink(InvokeMethod.ReturnType) + "  ");
                writer.Write(this, Documentation.GetReturns());
            }

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle($"{Parent.Name}.{Name}", "Property");

            writer.Write(this, Documentation.GetSummary());

            writer.WriteLine("```csharp");
            writer.WriteLine(CodeAmbience.ConvertSymbol(Property));
            writer.WriteLine("```");

            // attributes

            writer.WriteDocItems(Parameters, "#### Parameters");

            if (Property.ReturnType.Kind != TypeKind.Void)
            {
                writer.WriteLine("#### Property Value");
                writer.WriteLine(writer.GetTypeLink(Property.ReturnType) + "  ");
                writer.Write(this, Documentation.GetValue());
            }

            writer.WriteExceptions(this);

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
示例#4
0
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();

            writer.Write(this, Documentation.GetSummary());

            writer.Write("### Remarks", Documentation.GetRemarks(), this);

            writer.WriteChildrenLink <NamespaceDocItem>("Namespaces");
        }
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteLinkTarget(this);
            writer.WriteLine($"`{Name}` {Field.GetConstantValue()}  ");

            writer.Write(this, Documentation.GetSummary());

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
示例#6
0
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteLinkTarget(this);
            writer.WriteLine($"`{TypeParameter.Name}`  ");
            writer.Write(this, Documentation);

            if (TypeParameter.TypeConstraints.Any(c => !c.Type.IsObjectOrValueType()))
            {
                writer.Break();

                writer.Write("Constraints ");
                writer.Write(string.Join(", ", TypeParameter.TypeConstraints.Select(c => c.Type).Where(t => !t.IsObjectOrValueType()).Select(writer.GetTypeLink)));
                writer.WriteLine("  ");
            }
        }
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, "Namespace");

            writer.Write(this, Documentation.GetSummary());

            writer.Write("### Remarks", Documentation.GetRemarks(), this);

            writer.WriteChildrenLink <ClassDocItem>("Classes");
            writer.WriteChildrenLink <StructDocItem>("Structs");
            writer.WriteChildrenLink <InterfaceDocItem>("Interfaces");
            writer.WriteChildrenLink <EnumDocItem>("Enums");
            writer.WriteChildrenLink <DelegateDocItem>("Delegates");
        }
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle($"{Parent.Name}.{Name}", "Field");

            writer.Write(this, Documentation.GetSummary());

            writer.WriteLine("```csharp");
            writer.WriteLine(CodeAmbience.ConvertSymbol(Field));
            writer.WriteLine("```");
            // todo attributes

            writer.WriteLine("#### Field Value");
            writer.WriteLine($"{writer.GetTypeLink(Field.Type)}  ");

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
示例#9
0
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle($"{Parent.Name}.{Name}", "Event");

            writer.Write(this, Documentation.GetSummary());

            writer.WriteLine("```csharp");
            writer.WriteLine(CodeAmbience.ConvertSymbol(Event));
            writer.WriteLine("```");
            // attributes

            writer.WriteLine("#### Event type");
            writer.WriteLine(writer.GetTypeLink(this, Event.ReturnType));

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, "Constructor");

            writer.Write(this, Documentation.GetSummary());

            writer.WriteLine("```csharp");
            writer.WriteLine(CodeAmbience.ConvertSymbol(Method));
            writer.WriteLine("```");

            // attributes

            writer.WriteDocItems(Parameters, "#### Parameters");

            writer.WriteExceptions(this);

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
示例#11
0
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, Type.Kind.ToString());

            writer.Write(this, Documentation.GetSummary());

            writer.WriteLine("```csharp");
            writer.Write(CodeAmbience.ConvertSymbol(Type));
            IType enumType = Type.GetEnumUnderlyingType();

            writer.WriteLine(enumType.IsKnownType(KnownTypeCode.Int32) ? string.Empty : $" : {enumType.FullName}");
            writer.WriteLine("```");

            // attribute

            writer.WriteDocItems <EnumFieldDocItem>("### Fields");

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);
        }
示例#12
0
 public override void WriteDocumentation(DocumentationWriter writer)
 {
     writer.WriteLinkTarget(this);
     writer.WriteLine($"`{Parameter.Name}` {writer.GetTypeLink(this, Parameter.Type)}  ");
     writer.Write(this, Documentation);
 }
示例#13
0
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, Type.Kind.ToString());

            writer.Write(this, Documentation.GetSummary());

            List <IType> interfaces = Type.DirectBaseTypes.Where(t => t.Kind == TypeKind.Interface && t.GetDefinition().Accessibility == Accessibility.Public).ToList();

            writer.WriteLine("```csharp");
            writer.Write(CodeAmbience.ConvertSymbol(Type));
            IType baseType = Type.DirectBaseTypes.FirstOrDefault(t => t.Kind == TypeKind.Class && !t.IsKnownType(KnownTypeCode.Object) && !t.IsKnownType(KnownTypeCode.ValueType));

            if (baseType != null)
            {
                writer.Write(" : ");
                writer.Write(BaseTypeAmbience.ConvertType(baseType));
            }
            foreach (IType @interface in interfaces)
            {
                writer.WriteLine(baseType is null ? " :" : ",");
                baseType = Type;
                writer.Write(BaseTypeAmbience.ConvertType(@interface));
            }
            writer.Break();
            writer.WriteLine("```");

            bool needBreak = false;

            if (Type.Kind == TypeKind.Class)
            {
                writer.Write("Inheritance ");
                writer.Write(string.Join(" &#129106; ", Type.GetNonInterfaceBaseTypes().Where(t => t != Type).Select(writer.GetTypeLink)));
                writer.Write(" &#129106; ");
                writer.Write(Name);
                writer.WriteLine("  ");
                needBreak = true;
            }

            List <TypeDocItem> derived = writer.KnownItems.OfType <TypeDocItem>().Where(i => i.Type.DirectBaseTypes.Select(t => t is ParameterizedType g ? g.GetDefinition() : t).Contains(Type)).OrderBy(i => i.FullName).ToList();

            if (derived.Count > 0)
            {
                if (needBreak)
                {
                    writer.Break();
                }

                writer.Write("Derived  " + Environment.NewLine + "&#8627; ");
                writer.Write(string.Join("  " + Environment.NewLine + "&#8627; ", derived.Select(t => writer.GetLink(t))));
                writer.WriteLine("  ");
                needBreak = true;
            }

            // attribute

            if (interfaces.Count > 0)
            {
                if (needBreak)
                {
                    writer.Break();
                }

                writer.Write("Implements ");
                writer.Write(string.Join(", ", interfaces.Select(writer.GetTypeLink)));
                writer.WriteLine("  ");
            }

            writer.WriteDocItems(TypeParameters, "#### Type parameters");

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);

            writer.WriteDirectChildrenLink <ConstructorDocItem>("Constructors");
            writer.WriteDirectChildrenLink <FieldDocItem>("Fields");
            writer.WriteDirectChildrenLink <PropertyDocItem>("Properties");
            writer.WriteDirectChildrenLink <MethodDocItem>("Methods");
            writer.WriteDirectChildrenLink <EventDocItem>("Events");
            writer.WriteDirectChildrenLink <OperatorDocItem>("Operators");

            if (writer.NestedTypeVisibility == NestedTypeVisibility.DeclaringType ||
                writer.NestedTypeVisibility == NestedTypeVisibility.Everywhere)
            {
                writer.WriteDirectChildrenLink <ClassDocItem>("Classes");
                writer.WriteDirectChildrenLink <StructDocItem>("Structs");
                writer.WriteDirectChildrenLink <InterfaceDocItem>("Interfaces");
                writer.WriteDirectChildrenLink <EnumDocItem>("Enums");
                writer.WriteDirectChildrenLink <DelegateDocItem>("Delegates");
            }
        }
示例#14
0
        public override void WriteDocumentation(DocumentationWriter writer)
        {
            writer.WriteHeader();
            writer.WritePageTitle(Name, Type.Kind.ToString());

            writer.Write(this, Documentation.GetSummary());

            List <IType> interfaces = Type.DirectBaseTypes.Where(t => t.Kind == TypeKind.Interface && t.GetDefinition().Accessibility == Accessibility.Public).ToList();

            writer.WriteLine("```csharp");
            writer.Write(CodeAmbience.ConvertSymbol(Type));
            IType baseType = Type.DirectBaseTypes.FirstOrDefault(t => t.Kind == TypeKind.Class && !t.IsKnownType(KnownTypeCode.Object) && !t.IsKnownType(KnownTypeCode.ValueType));

            if (baseType != null)
            {
                writer.Write(" : ");
                writer.Write(BaseTypeAmbience.ConvertType(baseType));
            }
            foreach (IType @interface in interfaces)
            {
                writer.WriteLine(baseType is null ? " :" : ",");
                baseType = Type;
                writer.Write(BaseTypeAmbience.ConvertType(@interface));
            }
            writer.Break();
            writer.WriteLine("```");

            if (Type.Kind == TypeKind.Class)
            {
                writer.Write("Inheritance ");
                writer.Write(string.Join(" &gt; ", Type.GetNonInterfaceBaseTypes().Select(t => writer.GetTypeLink(this, t))));
                writer.WriteLine("  ");
                if (interfaces.Count > 0)
                {
                    writer.Break();
                }
            }

            // attribute

            if (interfaces.Count > 0)
            {
                writer.Write("Implements ");
                writer.Write(string.Join(", ", interfaces.Select(t => writer.GetTypeLink(this, t))));
                writer.WriteLine("  ");
            }

            writer.WriteDocItems(TypeParameters, "#### Type parameters");

            writer.Write("### Example", Documentation.GetExample(), this);
            writer.Write("### Remarks", Documentation.GetRemarks(), this);

            writer.WriteDirectChildrenLink <ConstructorDocItem>("Constructors");
            writer.WriteDirectChildrenLink <FieldDocItem>("Fields");
            writer.WriteDirectChildrenLink <PropertyDocItem>("Properties");
            writer.WriteDirectChildrenLink <MethodDocItem>("Methods");
            writer.WriteDirectChildrenLink <EventDocItem>("Events");
            writer.WriteDirectChildrenLink <OperatorDocItem>("Operators");
        }
 public override void WriteDocumentation(DocumentationWriter writer)
 {
     writer.WriteLinkTarget(this);
     writer.WriteLine($"`{TypeParameter.Name}`  ");
     writer.Write(this, Documentation);
 }