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);
        }
示例#3
0
        public override void Write(Converter converter, DocWriter writer)
        {
            writer.WriteLine($"### {Header}");
            string valueTypeName = Type.FullName.Replace('/', '.');

            converter.Items.TryGetValue($"{TypeItem.Id}{valueTypeName}", out AMemberItem valueTypeItem);
            writer.WriteLine(valueTypeItem?.AsLink() ?? valueTypeName.AsDotNetApiLink());

            converter.WriteSummary(writer, this);
        }
        public override void Write(Converter converter, DocWriter writer)
        {
            string parameterTypeName = Parameter.ParameterType.FullName.Replace('/', '.');

            converter.Items.TryGetValue($"{TypeItem.Id}{parameterTypeName}", out AMemberItem parameterTypeItem);

            writer.WriteLine(this.AsLinkTarget());
            writer.WriteLine($"`{Name}` {parameterTypeItem?.AsLink() ?? parameterTypeName.AsDotNetApiLink()}  ");
            converter.WriteSummary(writer, this);
        }
        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);
        }
示例#6
0
 public override void Write(Converter converter, DocWriter writer)
 {
     writer.Write(
         converter.Items.TryGetValue(Reference, out AMemberItem reference)
         ? reference.AsLink()
         : Reference.Substring(2).AsDotNetApiLink());
     writer.WriteLine("  ");
     converter.WriteSummary(writer, this);
 }
        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);

            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);
        }
示例#9
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);
        }
示例#10
0
 public virtual void Write(Converter converter, DocWriter writer)
 {
     writer.WriteLine($"### {Header}");
     converter.WriteSummary(writer, this);
 }
 public override void Write(Converter converter, DocWriter writer)
 {
     writer.WriteLine(this.AsLinkTarget());
     writer.WriteLine($"`{Name}`  ");
     converter.WriteSummary(writer, this);
 }