다음을 통해 공유


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

Syntax

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

Return Value

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

Implements

IDirectiveProcessor.GetPostInitializationCodeForProcessingRun

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 resemble:

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

Microsoft.VisualStudio.TextTemplating Namespace

GetPreInitializationCodeForProcessingRun

GetPostInitializationCodeForProcessingRun

Other Resources

Creating Custom T4 Text Template Directive Processors

Walkthrough: Creating a Custom Directive Processor