Share via


RequiresProvidesDirectiveProcessor.GetImportsForProcessingRun Method

Gets namespaces to import into the generated transformation class.

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

Syntax

'Declaration
Public Overrides Function GetImportsForProcessingRun As String()
'Usage
Dim instance As RequiresProvidesDirectiveProcessor 
Dim returnValue As String()

returnValue = instance.GetImportsForProcessingRun()
public override string[] GetImportsForProcessingRun()
public:
virtual array<String^>^ GetImportsForProcessingRun() override
public override function GetImportsForProcessingRun() : String[]

Return Value

Type: array<System.String[]
An array of type String that contains the namespaces.

Exceptions

Exception Condition
InvalidOperationException

A processing run has already started but not yet finished.

Remarks

To expose the code that is generated by a directive processor to the generated transformation class, have the directive processor add its namespace to the list of namespaces.

Examples

This example gets the set of extra namespaces that must be imported to compile the code that the directive processor generates. This code example is part of a larger example that is provided for the RequiresProvidesDirectiveProcessor class.

public override string[] GetImportsForProcessingRun()
{
List<string> imports = new List<string>();
imports.AddRange(base.GetImportsForProcessingRun());
imports.Add("System.Xml");
return imports.ToArray();
}

.NET Framework Security

See Also

Reference

RequiresProvidesDirectiveProcessor Class

RequiresProvidesDirectiveProcessor Members

Microsoft.VisualStudio.TextTemplating Namespace

GetReferencesForProcessingRun

GetClassCodeForProcessingRun

GetImportsForProcessingRun