예제 #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="IndexerOverloadDocumentation"/>
        /// </summary>
        /// <param name="indexerDocumentation">The documentation model of the indexer being overloaded.</param>
        /// <param name="definition">The underlying Mono.Cecil definition of the indexer.</param>
        /// <param name="xmlDocsProvider">The XML documentation provider to use for loading XML documentation comments.</param>
        internal IndexerOverloadDocumentation(
            IndexerDocumentation indexerDocumentation,
            PropertyDefinition definition,
            IXmlDocsProvider xmlDocsProvider) : base(definition.ToMemberId(), xmlDocsProvider)
        {
            IndexerDocumentation = indexerDocumentation ?? throw new ArgumentNullException(nameof(indexerDocumentation));
            Definition           = definition ?? throw new ArgumentNullException(nameof(definition));
            xmlDocsProvider      = xmlDocsProvider ?? throw new ArgumentNullException(nameof(xmlDocsProvider));

            Parameters = definition.HasParameters
                ? definition.Parameters.Select(p => new ParameterDocumentation(this, p, xmlDocsProvider)).ToArray()
                : Array.Empty <ParameterDocumentation>();

            Type             = definition.PropertyType.ToTypeId();
            Signature        = SignatureFormatter.GetSignature(definition);
            CSharpDefinition = CSharpDefinitionFormatter.GetDefinition(definition);
            Value            = xmlDocsProvider.TryGetDocumentationComments(MemberId)?.Value;

            IsObsolete      = definition.IsObsolete(out var obsoleteMessage);
            ObsoleteMessage = obsoleteMessage;
        }
예제 #2
0
 /// <inheritdoc />
 public override IDocumentation?TryGetDocumentation(MemberId id) =>
 MemberId.Equals(id) ? this : IndexerDocumentation.TryGetDocumentation(id);