示例#1
0
        public static bool TryParseIgnoredRootParts(IEnumerable <string> values, out RootDocumentationParts parts)
        {
            if (!values.Any())
            {
                parts = DocumentationOptions.Default.IgnoredRootParts;
                return(true);
            }

            parts = RootDocumentationParts.None;

            foreach (string value in values)
            {
                if (Enum.TryParse(value.Replace("-", ""), ignoreCase: true, out RootDocumentationParts result))
                {
                    parts |= result;
                }
                else
                {
                    WriteLine($"Unknown root documentation part '{value}'.", Verbosity.Quiet);
                    return(false);
                }
            }

            return(true);
        }
        internal string GetHeading(RootDocumentationParts part)
        {
            switch (part)
            {
            case RootDocumentationParts.Namespaces:
                return(NamespacesTitle);

            case RootDocumentationParts.Classes:
                return(ClassesTitle);

            case RootDocumentationParts.StaticClasses:
                return(StaticClassesTitle);

            case RootDocumentationParts.Structs:
                return(StructsTitle);

            case RootDocumentationParts.Interfaces:
                return(InterfacesTitle);

            case RootDocumentationParts.Enums:
                return(EnumsTitle);

            case RootDocumentationParts.Delegates:
                return(DelegatesTitle);

            case RootDocumentationParts.Other:
                return(OtherTitle);

            default:
                throw new ArgumentException("", nameof(part));
            }
        }
 public GenerateDocRootCommand(
     GenerateDocRootCommandLineOptions options,
     DocumentationDepth depth,
     RootDocumentationParts ignoredParts,
     IncludeContainingNamespaceFilter includeContainingNamespaceFilter,
     Visibility visibility,
     in ProjectFilter projectFilter) : base(projectFilter)
示例#4
0
 public GenerateDocCommand(
     GenerateDocCommandLineOptions options,
     DocumentationDepth depth,
     RootDocumentationParts ignoredRootParts,
     NamespaceDocumentationParts ignoredNamespaceParts,
     TypeDocumentationParts ignoredTypeParts,
     MemberDocumentationParts ignoredMemberParts,
     IncludeContainingNamespaceFilter includeContainingNamespaceFilter,
     Visibility visibility,
     in ProjectFilter projectFilter) : base(projectFilter)
        internal string GetHeading(RootDocumentationParts part)
        {
            switch (part)
            {
            case RootDocumentationParts.Namespaces:
                return(NamespacesTitle);

            case RootDocumentationParts.ClassHierarchy:
                return(ClassHierarchyTitle);

            case RootDocumentationParts.Other:
                return(OtherTitle);

            default:
                throw new ArgumentException("", nameof(part));
            }
        }
示例#6
0
        public DocumentationOptions(
            IEnumerable <string> ignoredNames = null,
            string preferredCultureName       = null,
            string rootDirectoryUrl           = null,
            int maxDerivedTypes               = DefaultValues.MaxDerivedTypes,
            bool includeClassHierarchy        = DefaultValues.IncludeClassHierarchy,
            bool placeSystemNamespaceFirst    = DefaultValues.PlaceSystemNamespaceFirst,
            bool formatDeclarationBaseList    = DefaultValues.FormatDeclarationBaseList,
            bool formatDeclarationConstraints = DefaultValues.FormatDeclarationConstraints,
            bool markObsolete = DefaultValues.MarkObsolete,
            bool includeMemberInheritedFrom       = DefaultValues.IncludeMemberInheritedFrom,
            bool includeMemberOverrides           = DefaultValues.IncludeMemberOverrides,
            bool includeMemberImplements          = DefaultValues.IncludeMemberImplements,
            bool includeMemberConstantValue       = DefaultValues.IncludeMemberConstantValue,
            bool includeInheritedInterfaceMembers = DefaultValues.IncludeInheritedInterfaceMembers,
            bool includeAllDerivedTypes           = DefaultValues.IncludeInheritedInterfaceMembers,
            bool includeAttributeArguments        = DefaultValues.IncludeAttributeArguments,
            bool includeInheritedAttributes       = DefaultValues.IncludeInheritedAttributes,
            bool omitIEnumerable                                      = DefaultValues.OmitIEnumerable,
            DocumentationDepth depth                                  = DefaultValues.Depth,
            InheritanceStyle inheritanceStyle                         = DefaultValues.InheritanceStyle,
            RootDocumentationParts ignoredRootParts                   = RootDocumentationParts.None,
            NamespaceDocumentationParts ignoredNamespaceParts         = NamespaceDocumentationParts.None,
            TypeDocumentationParts ignoredTypeParts                   = TypeDocumentationParts.None,
            MemberDocumentationParts ignoredMemberParts               = MemberDocumentationParts.None,
            OmitContainingNamespaceParts omitContainingNamespaceParts = OmitContainingNamespaceParts.None,
            bool scrollToContent                                      = DefaultValues.ScrollToContent)
        {
            if (maxDerivedTypes < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(maxDerivedTypes), maxDerivedTypes, "Maximum number of derived items must be greater than or equal to 0.");
            }

            _ignoredMetadataNames = ignoredNames?.Select(name => MetadataName.Parse(name)).ToImmutableArray() ?? default;

            IgnoredNames                     = ignoredNames?.ToImmutableArray() ?? ImmutableArray <string> .Empty;
            PreferredCultureName             = preferredCultureName;
            RootDirectoryUrl                 = rootDirectoryUrl;
            MaxDerivedTypes                  = maxDerivedTypes;
            IncludeClassHierarchy            = includeClassHierarchy;
            PlaceSystemNamespaceFirst        = placeSystemNamespaceFirst;
            FormatDeclarationBaseList        = formatDeclarationBaseList;
            FormatDeclarationConstraints     = formatDeclarationConstraints;
            MarkObsolete                     = markObsolete;
            IncludeMemberInheritedFrom       = includeMemberInheritedFrom;
            IncludeMemberOverrides           = includeMemberOverrides;
            IncludeMemberImplements          = includeMemberImplements;
            IncludeMemberConstantValue       = includeMemberConstantValue;
            IncludeInheritedInterfaceMembers = includeInheritedInterfaceMembers;
            IncludeAllDerivedTypes           = includeAllDerivedTypes;
            IncludeAttributeArguments        = includeAttributeArguments;
            IncludeInheritedAttributes       = includeInheritedAttributes;
            OmitIEnumerable                  = omitIEnumerable;
            Depth                        = depth;
            InheritanceStyle             = inheritanceStyle;
            IgnoredRootParts             = ignoredRootParts;
            IgnoredNamespaceParts        = ignoredNamespaceParts;
            IgnoredTypeParts             = ignoredTypeParts;
            IgnoredMemberParts           = ignoredMemberParts;
            OmitContainingNamespaceParts = omitContainingNamespaceParts;
            ScrollToContent              = scrollToContent;
        }
 public GenerateDocRootCommand(
     GenerateDocRootCommandLineOptions options,
     DocumentationDepth depth,
     RootDocumentationParts ignoredParts,
     Visibility visibility,
     in ProjectFilter projectFilter) : base(projectFilter)