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);
        }
Exemple #3
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.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);
        }
Exemple #5
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);
        }
Exemple #6
0
 public override void WriteDocumentation(DocumentationWriter writer)
 {
     writer.WriteLinkTarget(this);
     writer.WriteLine($"`{Parameter.Name}` {writer.GetTypeLink(this, Parameter.Type)}  ");
     writer.Write(this, Documentation);
 }