MarkupWriter.WriteDocLink Method

Namespace
Kampute.DocToolkit.IO.Writers
Assembly
  • Kampute.DocToolkit.dll
MarkupWriter.WriteDocLink(MemberModel)Writes a hyperlink to the documentation of the specified member model.
MarkupWriter.WriteDocLink(NamespaceModel)Writes a hyperlink to the documentation of the specified namespace model.
MarkupWriter.WriteDocLink(Uri, Action<MarkupWriter>)Writes a hyperlink to the documentation of a code element with the specified URL and delegate for writing the link text.
MarkupWriter.WriteDocLink(IMember, IDocumentationContext)Writes a hyperlink to the documentation of the specified member.
MarkupWriter.WriteDocLink(IMember, IDocumentationContext, NameQualifier)Writes a hyperlink to the documentation of the specified member with a specific name qualification level.
MarkupWriter.WriteDocLink(string, IDocumentationContext, Func<IMember, NameQualifier>)Writes a hyperlink to the documentation of the specified code reference.
MarkupWriter.WriteDocLink(ICustomAttribute, IDocumentationContext, NameQualifier)Writes a hyperlink to the documentation of the specified attribute.

MarkupWriter.WriteDocLink(MemberModel)

Writes a hyperlink to the documentation of the specified member model.
public virtual void WriteDocLink(MemberModel member)

Parameters

member MemberModel
The member for which the link is written.

Exceptions

ArgumentNullException
Thrown when member is null.

Remarks

This method writes a hyperlink to the documentation for the specified member. If the member has a valid documentation URL, a hyperlink is written using the member's signature formatted according to the rules of the programming language specified in the member's context. If no URL exists, the member's signature is written as plain text.

The qualification level for the member's name is determined based on the member's type and whether it is part of the current documentation scope.

MarkupWriter.WriteDocLink(NamespaceModel)

Writes a hyperlink to the documentation of the specified namespace model.
public virtual void WriteDocLink(NamespaceModel ns)

Parameters

ns NamespaceModel
The namespace for which the link is written.

Exceptions

ArgumentNullException
Thrown when ns is null.

Remarks

This method writes a hyperlink to the documentation for the specified namespace. If the namespace has has a valid documentation URL, a hyperlink is written using the namespace's name. If the namespace does not have documentation URL, the namespace's name is written as plain text.

MarkupWriter.WriteDocLink(Uri, Action<MarkupWriter>)

Writes a hyperlink to the documentation of a code element with the specified URL and delegate for writing the link text.
protected virtual void WriteDocLink(Uri docUrl, Action<MarkupWriter> docLinkTextHandler)

Parameters

docUrl Uri
The URI of the documentation page to link to.
docLinkTextHandler Action<MarkupWriter>
The action to write the text of the link, typically the name of the code element.

Exceptions

ArgumentNullException
Thrown when docUrl or docLinkTextHandler is null.

Remarks

This method writes a hyperlink to the documentation of a code element with the specified text. The text is typically the name of the code element, and the hyperlink points to the documentation page for the code element.

The default implementation of this method calls MarkupWriter.WriteLink(Uri, Action<MarkupWriter>) to write the hyperlink. Derived classes can override this method to provide custom behavior for writing links to documentation.

MarkupWriter.WriteDocLink(IMember, IDocumentationContext)

Writes a hyperlink to the documentation of the specified member.
public void WriteDocLink(IMember member, IDocumentationContext context)

Parameters

member IMember
The member for which the link is written.
context IDocumentationContext
The documentation context used to resolve the link and format the member's signature.

Exceptions

ArgumentNullException
Thrown when member or context is null.

Remarks

This method writes a hyperlink to the documentation for the specified member. It uses the provided context to resolve the member's documentation URL and format its signature. The signature is formatted according to the rules of the programming language specified in the context. Depending on type of the member and whether it is part of the current documentation scope, the method determines an appropriate level of name qualification to use when formatting the member's signature.

When a valid documentation URL is available for the specified member, a hyperlink is written using the member’s signature. For example, the hyperlink for ICollection<T>.Count will display as "ICollection<T>.Count" with a hyperlink to the documentation of the Count property in the ICollection<T> interface.

If no direct URL exists for a member, this method attempts to generate links for individual components of the member when possible. For example, the writing of a hyperlink for ICollection<DateTime>.Count will result in separate links for "ICollection" linked to ICollection<T>, "DateTime" linked to DateTime, and "Count" linked to ICollection<T>.Count.

MarkupWriter.WriteDocLink(IMember, IDocumentationContext, NameQualifier)

Writes a hyperlink to the documentation of the specified member with a specific name qualification level.
public virtual void WriteDocLink(IMember member, IDocumentationContext context, NameQualifier qualifier)

Parameters

member IMember
The member for which the link is written.
context IDocumentationContext
The documentation context used to resolve the link and format the member's signature.
qualifier NameQualifier
The level of qualification to use for the member's name.

Exceptions

ArgumentNullException
Thrown when member or context is null.

Remarks

This method writes a hyperlink to the documentation for the specified member. It uses the provided context to resolve the member's documentation URL and format its signature. The signature is formatted according to the rules of the programming language specified in the context. For the member's name, the method uses the level of qualification specified by qualifier.

When a valid documentation URL is available for the specified member, a hyperlink is written using the member’s signature. For example, the hyperlink for ICollection<T>.Count will display as "ICollection<T>.Count" with a hyperlink to the documentation of the Count property in the ICollection<T> interface.

If no direct URL exists for a member, this method attempts to generate links for individual components of the member when possible. For example, the writing of a hyperlink for ICollection<DateTime>.Count will result in separate links for "ICollection" linked to ICollection<T>, "DateTime" linked to DateTime, and "Count" linked to ICollection<T>.Count.

MarkupWriter.WriteDocLink(string, IDocumentationContext, Func<IMember, NameQualifier>)

Writes a hyperlink to the documentation of the specified code reference.
public virtual void WriteDocLink(string cref, IDocumentationContext context, Func<IMember, NameQualifier> qualifierSelector = null)

Parameters

cref string
The code reference for which the link is written.
context IDocumentationContext
The documentation context used to resolve the link and format the code reference.
qualifierSelector Func<IMember, NameQualifier> optional
An optional function to determine the level of qualification to use for the member's name if the code reference resolves to a member.

Exceptions

ArgumentNullException
Thrown when cref or context is null.

Remarks

This method writes a hyperlink to the documentation for the specified code reference. It uses the provided context to resolve the documentation URL of the reference and format its signature. The signature is formatted according to the rules of the programming language specified in the context.

If the code reference resolves to a member, the method uses the qualifierSelector function to determine the appropriate level of name qualification to use when formatting the member's signature. If no function is provided, the method uses the most suitable qualification level based on the current documentation scope.

If the code reference cannot be resolved to a member, but represents a namespace, the method attempts to retrieve the documentation URL for the namespace and writes a link using the namespace name as the link text.

If the code reference cannot be resolved to either a member or a namespace, the method writes the code reference as plain text without a hyperlink.

MarkupWriter.WriteDocLink(ICustomAttribute, IDocumentationContext, NameQualifier)

Writes a hyperlink to the documentation of the specified attribute.
public virtual void WriteDocLink(ICustomAttribute attribute, IDocumentationContext context, NameQualifier qualifier)

Parameters

attribute ICustomAttribute
The attribute for which the link is written.
context IDocumentationContext
The documentation context used to resolve the link and format the attribute and its parameters.
qualifier NameQualifier
The level of qualification to use for the attribute's name.

Exceptions

ArgumentNullException
Thrown when context or attribute is null.

Remarks

This method writes the specified attribute as a hyperlink to the documentation of the attribute's type. It uses the provided context to resolve the documentation URL of the attribute and format it. The output includes the attribute's type and any parameters and properties it may have.