public override void Write(Converter converter, DocWriter writer) { writer.WriteLine($"## {Name} `{Title}`"); converter.WriteSummary(writer, this); TypeReference fieldType = Field.FieldType; string fieldTypeName = fieldType.FullName.Replace('/', '.'); converter.Items.TryGetValue($"{TypeItem.Id}{fieldTypeName}", out AMemberItem parentTypeItem); writer.WriteLine("```C#"); writer.Write("public "); if (Field.IsStatic) { writer.Write("static "); } if (Field.IsInitOnly) { writer.Write("readonly "); } writer.WriteLine($"{parentTypeItem?.FullName ?? fieldTypeName} {Name};"); writer.WriteLine("```"); writer.WriteLine("#### Field Value"); writer.WriteLine(parentTypeItem?.AsLink() ?? fieldTypeName.AsDotNetApiLink()); base.Write(converter, writer); }
public override void Write(Converter converter, DocWriter writer) { writer.WriteLine($"## {Name} `{Title}`"); converter.WriteSummary(writer, this); writer.WriteLine("```C#"); writer.Write("public "); if (Constructor.IsStatic) { writer.Write("static "); } writer.WriteLine($"{Parent.Name}({string.Join(", ", Parameters.Select(p => p.Signature))});"); writer.WriteLine("```"); if (Parameters.Length > 0) { writer.WriteLine($"### {Parameters[0].Header}"); foreach (ParameterItem parameter in Parameters) { parameter.Write(converter, writer); writer.Break(); } } base.Write(converter, writer); }
public override void Write(Converter converter, DocWriter writer) { writer.WriteLine($"## {Name} `{Title}`"); converter.WriteSummary(writer, this); TypeReference fieldType = Event.EventType; string fieldTypeName = fieldType.FullName.Replace('/', '.'); converter.Items.TryGetValue($"{TypeItem.Id}{fieldTypeName}", out AMemberItem parentTypeItem); writer.WriteLine("```C#"); writer.Write("public "); if (Event.AddMethod?.IsStatic ?? Event.RemoveMethod?.IsStatic ?? false) { writer.Write("static "); } writer.WriteLine($"event {parentTypeItem?.FullName ?? fieldTypeName} {Name};"); writer.WriteLine("```"); writer.WriteLine("#### Event Type"); writer.WriteLine(parentTypeItem?.AsLink() ?? fieldTypeName.AsDotNetApiLink()); base.Write(converter, writer); }
public override void Write(Converter converter, DocWriter writer) { writer.WriteLine($"## {Name} `{Title}`"); converter.WriteSummary(writer, this); writer.WriteLine("```C#"); writer.Write("public "); switch (Title) { case "delegate": break; case "enum": break; case "interface": break; case "struct": break; case "class": if (Type.IsAbstract && Type.IsSealed) { writer.Write("static "); } else if (Type.IsAbstract) { writer.Write("abstract "); } else if (Type.IsSealed) { writer.Write("sealed "); } break; } writer.WriteLine($"{Title} {Name};"); writer.WriteLine("```"); bool hasHeader = false; foreach (GenericItem parameter in Generics) { if (!hasHeader) { writer.WriteLine($"### {parameter.Header}"); hasHeader = true; } else { writer.Break(); } parameter.Write(converter, writer); } base.Write(converter, writer); }
public override void Write(Converter converter, DocWriter writer) { writer.WriteLine($"## {Name} `{Title}`"); converter.WriteSummary(writer, this); writer.WriteLine("```C#"); writer.Write("public "); if (Property.SetMethod?.IsStatic ?? Property.GetMethod?.IsStatic ?? false) { writer.Write("static "); } if (Parameters.Length > 0) { writer.Write($"this[{string.Join(", ", Parameters.Select(p => p.Signature))}] {{"); } else { writer.Write($"{Value.Type.FullName} {{ "); } if (Property.GetMethod != null) { writer.Write(" get;"); } if (Property.SetMethod != null) { writer.Write(" set;"); } writer.WriteLine("}}"); writer.WriteLine("```"); if (Parameters.Length > 0) { writer.WriteLine($"### {Parameters[0].Header}"); foreach (ParameterItem parameter in Parameters) { parameter.Write(converter, writer); writer.Break(); } } Value.Write(converter, writer); base.Write(converter, writer); }