예제 #1
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;
        }
예제 #2
0
        /// <inheritdoc/>
        public override string ModelSummary()
        {
            using (StringWriter htmlWriter = new StringWriter())
            {
                if (FormatForParentControl)
                {
                    if (!(CurrentAncestorList.Count >= 3 && CurrentAncestorList[CurrentAncestorList.Count - 3] == typeof(RuminantInitialCohorts).Name))
                    {
                        bool isgroupattribute = (CurrentAncestorList.Count >= 2 && CurrentAncestorList[CurrentAncestorList.Count - 2] == typeof(RuminantInitialCohorts).Name);

                        htmlWriter.Write("\r\n<div class=\"resourcebanneralone clearfix\">");
                        htmlWriter.Write($"Attribute  ");
                        if (AttributeName == null || AttributeName == "")
                        {
                            htmlWriter.Write("<span class=\"errorlink\">NOT SET</span>");
                        }
                        else
                        {
                            htmlWriter.Write($"<span class=\"setvalue\">{AttributeName}</span>");
                        }

                        if (StandardDeviation == 0)
                        {
                            htmlWriter.Write($" is provided {(isgroupattribute?"to all cohorts":"")} with a value of <span class=\"setvalue\">{Value.ToString()}</span> ");
                        }
                        else
                        {
                            htmlWriter.Write($" is provided {(isgroupattribute ? "to all cohorts" : "")} with a value taken from mean = <span class=\"setvalue\">{Value.ToString()}</span> and s.d. = <span class=\"setvalue\">{StandardDeviation}</span>");
                        }

                        htmlWriter.Write($"</div>");
                    }
                }
                else
                {
                    htmlWriter.Write($"\r\n<div class=\"activityentry\">");
                    htmlWriter.Write($"Provide an attribute with the label ");
                    if (AttributeName == null || AttributeName == "")
                    {
                        htmlWriter.Write("<span class=\"errorlink\">NOT SET</span>");
                    }
                    else
                    {
                        htmlWriter.Write($"<span class=\"setvalue\">{AttributeName}</span>");
                    }

                    htmlWriter.Write($" that will be inherited with the <span class=\"setvalue\">{InheritanceStyle.ToString()}</span> style");
                    if (Mandatory)
                    {
                        htmlWriter.Write($" and is required by all individuals in the population");
                    }

                    htmlWriter.Write($"</div>");

                    htmlWriter.Write($"\r\n<div class=\"activityentry\">");
                    if (StandardDeviation == 0)
                    {
                        htmlWriter.Write($"This attribute has a value of <span class=\"setvalue\">{Value.ToString()}</span> ");
                    }
                    else
                    {
                        htmlWriter.Write($"This attribute's value is randonly taken from the normal distribution with a mean of <span class=\"setvalue\">{Value.ToString()}</span> and standard deviation of <span class=\"setvalue\">{StandardDeviation}</span> ");
                    }

                    if (InheritanceStyle != AttributeInheritanceStyle.None)
                    {
                        htmlWriter.Write($" and is allowed to vary between <span class=\"setvalue\">{MinimumValue}</span> and <span class=\"setvalue\">{MaximumValue}</span> when inherited");
                    }

                    htmlWriter.Write($"</div>");
                }
                return(htmlWriter.ToString());
            }
        }