Share via


DirectiveProcessor.GetPostInitializationCodeForProcessingRun Method

When overridden in a derived class, gets code to add to the end of the initialize method of the generated transformation class.

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

Syntax

'Declaration
Public MustOverride Function GetPostInitializationCodeForProcessingRun As String
'Usage
Dim instance As DirectiveProcessor 
Dim returnValue As String 

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

Return Value

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

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 following pseudo-code shows what the Initialize method of the generated transformation class might look like:

Method GeneratedTransformationClassInstance.Initialize()

{

<code added by GetPreInitializationCodeForProcessingRun()>

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

<code added by GetPostInitializationCodeForProcessingRun()>

}

Examples

The following code example shows a possible implementation for a custom directive processor. This code example is part of a larger example provided for the DirectiveProcessor class.

public override string GetPostInitializationCodeForProcessingRun()
{
    //we do not need any post-initialization so we will just return ""
    //-----------------------------------------------------------------
    return String.Empty;
}
Public Overrides Function GetPostInitializationCodeForProcessingRun() As String

    'we do not need any post-initialization so we'll just return ""
    '-----------------------------------------------------------------
    Return String.Empty
End Function

.NET Framework Security

See Also

Reference

DirectiveProcessor Class

DirectiveProcessor Members

Microsoft.VisualStudio.TextTemplating Namespace

GetPreInitializationCodeForProcessingRun

GetPostInitializationCodeForProcessingRun

Other Resources

Creating Custom Text Template Directive Processors

Walkthrough: Creating a Custom Directive Processor