Condividi tramite


DirectiveProcessor.GetClassCodeForProcessingRun Method

When overridden in a derived class, gets code to add to 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 GetClassCodeForProcessingRun As String
public abstract string GetClassCodeForProcessingRun()
public:
virtual String^ GetClassCodeForProcessingRun() abstract
abstract GetClassCodeForProcessingRun : unit -> string
public abstract function GetClassCodeForProcessingRun() : String

Return Value

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

Implements

IDirectiveProcessor.GetClassCodeForProcessingRun

Remarks

The directive processor can use a buffer to store the code that gets added to the

generated transformation class after all the processing has finished. The code is added to the generated transformation class as new members of the class, not inside existing members of the class.

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.

private StringBuilder codeBuffer;
public override string GetClassCodeForProcessingRun()
{
    //Return the code to add to the generated transformation class.
    //-----------------------------------------------------------------
    return codeBuffer.ToString();
}
Private codeBuffer As StringBuilder
Public Overrides Function GetClassCodeForProcessingRun() As String

    'Return the code to add to the generated transformation class.
    '-----------------------------------------------------------------
    Return codeBuffer.ToString()
End Function

.NET Framework Security

See Also

Reference

DirectiveProcessor Class

Microsoft.VisualStudio.TextTemplating Namespace

GetImportsForProcessingRun

GetReferencesForProcessingRun

GetClassCodeForProcessingRun

Other Resources

Creating Custom T4 Text Template Directive Processors

Walkthrough: Creating a Custom Directive Processor