private static string GenerateDocComments(FieldModel field, bool generate)
        {
            if (generate && !string.IsNullOrWhiteSpace(field.Description))
            {
                var builder = new StringBuilder();
                DocCommentGenerator.GenerateSummary(field.Description, 8, builder);

                if (field.Args != null)
                {
                    foreach (var arg in field.Args)
                    {
                        if (!string.IsNullOrWhiteSpace(arg.Description))
                        {
                            var description = string.Join(" ", arg.Description.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)).Trim();
                            builder.AppendLine($"        /// <param name=\"{arg.Name}\">{description}</param>");
                        }
                    }
                }

                return(builder.ToString());
            }
            else
            {
                return(null);
            }
        }
예제 #2
0
        private static string GenerateDocComments(FieldModel field)
        {
            if (!string.IsNullOrWhiteSpace(field.Description))
            {
                var builder = new StringBuilder();
                DocCommentGenerator.GenerateSummary(field.Description, 8, builder);

                if (field.Args != null)
                {
                    foreach (var arg in field.Args)
                    {
                        if (!string.IsNullOrWhiteSpace(arg.Description))
                        {
                            builder.AppendLine($"        /// <param name=\"{arg.Name}\">{arg.Description}</param>");
                        }
                    }
                }

                return(builder.ToString());
            }
            else
            {
                return(null);
            }
        }
 private static string GenerateDocComments(InputValueModel field)
 {
     if (!string.IsNullOrWhiteSpace(field.Description))
     {
         var builder = new StringBuilder();
         DocCommentGenerator.GenerateSummary(field.Description, 8, builder);
         return(builder.ToString());
     }
     else
     {
         return(null);
     }
 }
예제 #4
0
 private static string GenerateDocComments(TypeModel possibleType)
 {
     if (!string.IsNullOrWhiteSpace(possibleType.Description))
     {
         var builder = new StringBuilder();
         DocCommentGenerator.GenerateSummary(possibleType.Description, 8, builder);
         return(builder.ToString());
     }
     else
     {
         return(null);
     }
 }
 private static string GenerateDocComments(TypeModel type, bool generate)
 {
     if (generate && !string.IsNullOrWhiteSpace(type.Description))
     {
         var builder = new StringBuilder();
         DocCommentGenerator.GenerateSummary(type.Description, 4, builder);
         builder.Append("    ");
         return(builder.ToString().TrimStart());
     }
     else
     {
         return(null);
     }
 }