Beispiel #1
0
        /// <summary>
        /// Creates method comment.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>The method comment.</returns>
        public static string CreateMethodComment(string name)
        {
            List <string> parts = SpilitNameAndToLower(name, false);

            parts[0] = Pluralizer.Pluralize(parts[0]);
            parts.Insert(1, "the");
            return(string.Join(" ", parts) + ".");
        }
 /// <summary>
 /// Determines specific object name.
 /// </summary>
 /// <param name="specificType">The specific type.</param>
 /// <returns>The comment.</returns>
 private static string DetermineSpecificObjectName(TypeSyntax specificType)
 {
     if (specificType is IdentifierNameSyntax)
     {
         return(Pluralizer.Pluralize(((IdentifierNameSyntax)specificType).Identifier.ValueText) + ".");
     }
     else
     {
         // xxx will remind user to give it a specific name.
         return("xxx");
     }
 }
        /// <summary>
        /// Determines specific object name.
        /// </summary>
        /// <param name="specificType">The specific type.</param>
        /// <returns>The comment.</returns>
        private static string DetermineSpecificObjectName(TypeSyntax specificType)
        {
            string result = null;

            if (specificType is IdentifierNameSyntax)
            {
                result = Pluralizer.Pluralize(((IdentifierNameSyntax)specificType).Identifier.ValueText);
            }
            else if (specificType is PredefinedTypeSyntax)
            {
                result = (specificType as PredefinedTypeSyntax).Keyword.ValueText;
            }
            else if (specificType is GenericNameSyntax)
            {
                result = (specificType as GenericNameSyntax).Identifier.ValueText;
            }
            else
            {
                result = specificType.ToFullString();
            }
            return(result + ".");
        }