IVsSingleFileGeneratorAsync.GenerateAsync Method

Definition

Asynchronously executes the transformation.

public System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Generators.GeneratorResult> GenerateAsync (string inputFilePath, string inputFileContents, string defaultNamespace, System.IO.Stream outputStream, Microsoft.VisualStudio.Shell.Interop.IVsGeneratorProgress generatorProgress, System.Threading.CancellationToken cancellationToken = default);
abstract member GenerateAsync : string * string * string * System.IO.Stream * Microsoft.VisualStudio.Shell.Interop.IVsGeneratorProgress * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Shell.Generators.GeneratorResult>
Public Function GenerateAsync (inputFilePath As String, inputFileContents As String, defaultNamespace As String, outputStream As Stream, generatorProgress As IVsGeneratorProgress, Optional cancellationToken As CancellationToken = Nothing) As Task(Of GeneratorResult)

Parameters

inputFilePath
String

The full path of the input file.

inputFileContents
String

The contents of the input file.

defaultNamespace
String

The namespace into which the generated code will be placed. This parameter is only meaningful for custom tools that generate code.

outputStream
Stream

The stream containing the results of the generation, which should be written to the generated file.

generatorProgress
IVsGeneratorProgress

The IVsGeneratorProgress object through which the generator can report its progress to the project system.

cancellationToken
CancellationToken

A token whose cancellation will attempt to cancel the generation.

Returns

Task<GeneratorResult>

A task that corresponds to the file generation.

Applies to