ParsedXmlDoc Pennington.ApiMetadata
Structured representation of a parsed xmldoc comment split into its standard sections.
Properties
EmptyPennington.ApiMetadata.ParsedXmlDoc- Default:
new( Summary: [], Remarks: [], Params: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty, TypeParams: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty, Returns: [], Example: [], SeeAlso: [])Shared empty instance used when no xmldoc is available. ExampleSystem.Collections.Immutable.ImmutableArray<XmlDocNode>- Nodes from the
<example>element. HasExamplebool- True when
Examplecontains any nodes. HasRemarksbool- True when
Remarkscontains any nodes. HasReturnsbool- True when
Returnscontains any nodes. HasSummarybool- True when
Summarycontains any nodes. ParamsSystem.Collections.Immutable.ImmutableDictionary<string, System.Collections.Immutable.ImmutableArray<XmlDocNode>>- Per-parameter nodes keyed by parameter name, from
<param>elements. RemarksSystem.Collections.Immutable.ImmutableArray<XmlDocNode>- Nodes from the
<remarks>element. ReturnsSystem.Collections.Immutable.ImmutableArray<XmlDocNode>- Nodes from the
<returns>element. SeeAlsoSystem.Collections.Immutable.ImmutableArray<string>- Cref values collected from
<seealso>elements. SummarySystem.Collections.Immutable.ImmutableArray<XmlDocNode>- Nodes from the
<summary>element. TypeParamsSystem.Collections.Immutable.ImmutableDictionary<string, System.Collections.Immutable.ImmutableArray<XmlDocNode>>- Per-type-parameter nodes keyed by name, from
<typeparam>elements.
Constructors
.ctor
#public record ParsedXmlDoc(
ImmutableArray<XmlDocNode> Summary,
ImmutableArray<XmlDocNode> Remarks,
ImmutableDictionary<string, ImmutableArray<XmlDocNode>> Params,
ImmutableDictionary<string, ImmutableArray<XmlDocNode>> TypeParams,
ImmutableArray<XmlDocNode> Returns,
ImmutableArray<XmlDocNode> Example,
ImmutableArray<string> SeeAlso)
{
/// <summary>Shared empty instance used when no xmldoc is available.</summary>
public static ParsedXmlDoc Empty { get; } = new(
Summary: [],
Remarks: [],
Params: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty,
TypeParams: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty,
Returns: [],
Example: [],
SeeAlso: []);
/// <summary>True when <see cref="Summary"/> contains any nodes.</summary>
public bool HasSummary => Summary.Length > 0;
/// <summary>True when <see cref="Remarks"/> contains any nodes.</summary>
public bool HasRemarks => Remarks.Length > 0;
/// <summary>True when <see cref="Returns"/> contains any nodes.</summary>
public bool HasReturns => Returns.Length > 0;
/// <summary>True when <see cref="Example"/> contains any nodes.</summary>
public bool HasExample => Example.Length > 0;
}Structured representation of a parsed xmldoc comment split into its standard sections.
Parameters
SummaryImmutableArray<XmlDocNode>- Nodes from the
<summary>element. RemarksImmutableArray<XmlDocNode>- Nodes from the
<remarks>element. ParamsImmutableDictionary<string, ImmutableArray<XmlDocNode>>- Per-parameter nodes keyed by parameter name, from
<param>elements. TypeParamsImmutableDictionary<string, ImmutableArray<XmlDocNode>>- Per-type-parameter nodes keyed by name, from
<typeparam>elements. ReturnsImmutableArray<XmlDocNode>- Nodes from the
<returns>element. ExampleImmutableArray<XmlDocNode>- Nodes from the
<example>element. SeeAlsoImmutableArray<string>- Cref values collected from
<seealso>elements.
Pennington.ApiMetadata.ParsedXmlDoc
namespace Pennington.ApiMetadata;
/// Structured representation of a parsed xmldoc comment split into its standard sections.
public record ParsedXmlDoc
{
/// Structured representation of a parsed xmldoc comment split into its standard sections.
public record ParsedXmlDoc(
ImmutableArray<XmlDocNode> Summary,
ImmutableArray<XmlDocNode> Remarks,
ImmutableDictionary<string, ImmutableArray<XmlDocNode>> Params,
ImmutableDictionary<string, ImmutableArray<XmlDocNode>> TypeParams,
ImmutableArray<XmlDocNode> Returns,
ImmutableArray<XmlDocNode> Example,
ImmutableArray<string> SeeAlso)
{
/// <summary>Shared empty instance used when no xmldoc is available.</summary>
public static ParsedXmlDoc Empty { get; } = new(
Summary: [],
Remarks: [],
Params: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty,
TypeParams: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty,
Returns: [],
Example: [],
SeeAlso: []);
/// <summary>True when <see cref="Summary"/> contains any nodes.</summary>
public bool HasSummary => Summary.Length > 0;
/// <summary>True when <see cref="Remarks"/> contains any nodes.</summary>
public bool HasRemarks => Remarks.Length > 0;
/// <summary>True when <see cref="Returns"/> contains any nodes.</summary>
public bool HasReturns => Returns.Length > 0;
/// <summary>True when <see cref="Example"/> contains any nodes.</summary>
public bool HasExample => Example.Length > 0;
}
/// Shared empty instance used when no xmldoc is available.
public static ParsedXmlDoc Empty { get; } = new(
Summary: [],
Remarks: [],
Params: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty,
TypeParams: ImmutableDictionary<string, ImmutableArray<XmlDocNode>>.Empty,
Returns: [],
Example: [],
SeeAlso: []);
/// Nodes from the <example> element.
ImmutableArray<XmlDocNode> Example
;
/// True when Example contains any nodes.
public bool HasExample => Example.Length > 0;
/// True when Remarks contains any nodes.
public bool HasRemarks => Remarks.Length > 0;
/// True when Returns contains any nodes.
public bool HasReturns => Returns.Length > 0;
/// True when Summary contains any nodes.
public bool HasSummary => Summary.Length > 0;
/// Per-parameter nodes keyed by parameter name, from <param> elements.
ImmutableDictionary<string, ImmutableArray<XmlDocNode>> Params
;
/// Nodes from the <remarks> element.
ImmutableArray<XmlDocNode> Remarks
;
/// Nodes from the <returns> element.
ImmutableArray<XmlDocNode> Returns
;
/// Cref values collected from <seealso> elements.
ImmutableArray<string> SeeAlso
;
/// Nodes from the <summary> element.
ImmutableArray<XmlDocNode> Summary
;
/// Per-type-parameter nodes keyed by name, from <typeparam> elements.
ImmutableDictionary<string, ImmutableArray<XmlDocNode>> TypeParams
;
}