Delen via


RequiresProvidesDirectiveProcessor.GetPostInitializationCodeForProcessingRun Method

Gets code to initialize when the generated transformation class is initialized, as a consequence of the most recent processing run.

Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating.12.0 (in Microsoft.VisualStudio.TextTemplating.12.0.dll)

Syntax

'Declaration
Public Overrides Function GetPostInitializationCodeForProcessingRun As String
public override string GetPostInitializationCodeForProcessingRun()
public:
virtual String^ GetPostInitializationCodeForProcessingRun() override
abstract GetPostInitializationCodeForProcessingRun : unit -> string  
override GetPostInitializationCodeForProcessingRun : unit -> string
public override function GetPostInitializationCodeForProcessingRun() : String

Return Value

Type: System.String
A String that contains the code to add to the generated transformation class.

Implements

IDirectiveProcessor.GetPostInitializationCodeForProcessingRun

Exceptions

Exception Condition
InvalidOperationException

A processing run has already started but not yet finished.

Remarks

This method adds code to the end of the Initialize method of the generated transformation class. The Initialize method of the generated transformation class contains a call to the Initialize method of the base class, and this code is added after that call. For example, the Initialize method of the generated transformation class might resemble the following example:

Method GeneratedTransformationClassInstance.Initialize()
{
    <code added by GetPreInitializationCodeForProcessingRun()>

    base.Initialize()  *This is a call to TextTransformation.Initialize()

    <code added by GetPostInitializationCodeForProcessingRun()>
}

This method is overridden in RequiresProvidesDirectiveProcessor to return the contents of the codeBuffer passed to the GeneratePostInitializationCode method. You do not usually need to override this method in classes that derive from RequiresProvidesDirectiveProcessor.

.NET Framework Security

See Also

Reference

RequiresProvidesDirectiveProcessor Class

Microsoft.VisualStudio.TextTemplating Namespace

GetPreInitializationCodeForProcessingRun

GetPostInitializationCodeForProcessingRun

GeneratePostInitializationCode

Other Resources

Creating Custom T4 Text Template Directive Processors