DocumentationContextExtensions.TryTransformText Method
- Namespace
- Kampute.DocToolkit
- Assembly
- Kampute.DocToolkit.dll
Definition
Attempts to transform the specified text using the appropriate text transformer based on the file extension.
public static bool TryTransformText(
this IDocumentationContext context,
string fileExtension,
string text,
[NotNullWhen(true)] out string transformedText)Parameters
contextIDocumentationContext- The documentation context that provides the text transformer.
fileExtensionstring- The file extension to identify the appropriate text transformer.
textstring- The text to be transformed.
transformedTextstring- When this method returns, contains the transformed text if the transformation was successful; otherwise,
null. This parameter is passed uninitialized.
Returns
Exceptions
- ArgumentNullException
- Thrown when
context,fileExtension, ortextisnull.

textis empty, the method returns an empty string as the transformed text even if the format is not supported.