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);

            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);
        }
Exemple #3
0
        public override void Write(Converter converter, DocWriter writer)
        {
            if (Exceptions?.Length > 0)
            {
                writer.WriteLine($"### {Exceptions[0].Header}");

                foreach (ExceptionItem exception in Exceptions)
                {
                    writer.Break();
                    exception.Write(converter, writer);
                }
            }

            Example?.Write(converter, writer);
            Remarks?.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);
        }