Share via


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

Syntax

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

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

Return Value

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

Remarks

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

generated transformation class after all the processing is done. 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

DirectiveProcessor Members

Microsoft.VisualStudio.TextTemplating Namespace

GetImportsForProcessingRun

GetReferencesForProcessingRun

GetClassCodeForProcessingRun

Other Resources

Creating Custom Text Template Directive Processors

Walkthrough: Creating a Custom Directive Processor