Share 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 (in Microsoft.VisualStudio.TextTemplating.dll)

Syntax

'Declaration
Public Overrides Function GetPostInitializationCodeForProcessingRun As String
'Usage
Dim instance As RequiresProvidesDirectiveProcessor 
Dim returnValue As String 

returnValue = instance.GetPostInitializationCodeForProcessingRun()
public override string GetPostInitializationCodeForProcessingRun()
public:
virtual String^ GetPostInitializationCodeForProcessingRun() override
public override function GetPostInitializationCodeForProcessingRun() : String

Return Value

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

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

RequiresProvidesDirectiveProcessor Members

Microsoft.VisualStudio.TextTemplating Namespace

GetPreInitializationCodeForProcessingRun

GetPostInitializationCodeForProcessingRun

GeneratePostInitializationCode

Other Resources

Creating Custom Text Template Directive Processors