예제 #1
0
        public static void BuildTable <T>(MdStringEditor mb, MarkDownType parent, string label, List <T> array)
            where T : MarkDownBase
        {
            if (array.Count <= 0)
            {
                return;
            }
            mb.AppendLine("* * *");
            mb.AppendLine($"__{label}__");
            mb.AppendLine();
            var head = (parent.IsEnum)
                ? new[] { "Value", "Name", "Summary" }
                : new[] { "Name", "Summary" };
            IEnumerable <T> seq = array;

            if (!parent.IsEnum)
            {
                seq = array.OrderBy(x => x.Name);
            }
            var data = seq.Select(item => parent.IsEnum
                ? new[] { HelpUtils.WritePropertyType(item).ToLower(), HelpUtils.WritePropertyName(item), item.Summary }
                : new[] { item.Name, item.Summary });

            mb.Table(head, data);
            mb.AppendLine();
        }
예제 #2
0
 public static void CreateHeader(MdStringEditor mb, MarkDownType parent)
 {
     mb.Header(3, $"{parent.Prefix}");
     mb.AppendLine($"__Namespace__: {parent.RepresentType.Namespace}");
     mb.AppendLine("* * *");
     mb.AppendLine($"__Summary__: {parent.Summary}");
     mb.AppendLine();
 }
예제 #3
0
 public void MdStringEditor_AppendLine_Should_ReturnValidResult()
 {
     _editor.AppendLine("text01");
     _editor.AppendLine("text02");
     _editor.ToString().Should().Be("text01\r\ntext02\r\n");
 }