Ejemplo n.º 1
0
        private string GenerateConstructor(ConstructorInfo constructor, DocumentationCategory category)
        {
            var name       = DocumentationGenerator.GetCleanName(constructor.DeclaringType);
            var parameters = GenerateParameters(constructor.GetParameters(), category);

            return(category.Templates.Constructor
                   .Replace(_memberNameTag, name)
                   .Replace(_memberParametersTag, parameters));
        }
Ejemplo n.º 2
0
 public DocumentationType(Type type, DocumentationCategory category)
 {
     Type     = type;
     Name     = DocumentationGenerator.GetCleanName(type);
     RawName  = type.Name;
     NiceName = DocumentationGenerator.GetNiceName(Name);
     Id       = DocumentationGenerator.GetTypeId(type);
     Filename = GetFilename(category);
     Link     = category.GetLink(type);
 }
Ejemplo n.º 3
0
        private string GetTypeLink(Type type, DocumentationCategory category, string template)
        {
            var cleanName = DocumentationGenerator.GetCleanName(type);
            var niceName  = DocumentationGenerator.GetNiceName(cleanName);
            var id        = DocumentationGenerator.GetTypeId(type);

            return(template
                   .Replace(DocumentationGenerator.CategoryNameTag, category?.Name)
                   .Replace(DocumentationGenerator.CategoryNiceNameTag, category?.NiceName)
                   .Replace(DocumentationGenerator.CategoryIdTag, category?.Id)
                   .Replace(DocumentationGenerator.TypeIdTag, id)
                   .Replace(DocumentationGenerator.TypeNameTag, cleanName)
                   .Replace(DocumentationGenerator.TypeRawNameTag, type.Name)
                   .Replace(DocumentationGenerator.TypeNiceNameTag, niceName)
                   .Replace(DocumentationGenerator.TypeNamespaceTag, type.Namespace)
                   .Replace('`', '-'));             // this is specific to msdn but potentially makes sense for other scenarios as well
        }