Udostępnij za pośrednictwem


Metoda DirectiveProcessor.StartProcessingRun —

Po zastąpiony w klasie pochodnej, uruchamia Rundy dyrektywy przetwarzania.

Przestrzeń nazw:  Microsoft.VisualStudio.TextTemplating
Zestaw:  Microsoft.VisualStudio.TextTemplating.11.0 (w Microsoft.VisualStudio.TextTemplating.11.0.dll)

Składnia

'Deklaracja
Public Overridable Sub StartProcessingRun ( _
    languageProvider As CodeDomProvider, _
    templateContents As String, _
    errors As CompilerErrorCollection _
)
public virtual void StartProcessingRun(
    CodeDomProvider languageProvider,
    string templateContents,
    CompilerErrorCollection errors
)
public:
virtual void StartProcessingRun(
    CodeDomProvider^ languageProvider, 
    String^ templateContents, 
    CompilerErrorCollection^ errors
)
abstract StartProcessingRun : 
        languageProvider:CodeDomProvider * 
        templateContents:string * 
        errors:CompilerErrorCollection -> unit 
override StartProcessingRun : 
        languageProvider:CodeDomProvider * 
        templateContents:string * 
        errors:CompilerErrorCollection -> unit 
public function StartProcessingRun(
    languageProvider : CodeDomProvider, 
    templateContents : String, 
    errors : CompilerErrorCollection
)

Parametry

  • templateContents
    Typ: System.String
    Zawartość szablonu tekst, który jest przetwarzana.

Implementuje

IDirectiveProcessor.StartProcessingRun(CodeDomProvider, String, CompilerErrorCollection)

Uwagi

Dostawca domyślny język jest CSharpCodeProvider.

Przykłady

Poniższy przykład kodu pokazuje możliwe wdrożenie niestandardowych procesora w dyrektywie.Poniższy przykład kodu jest częścią większych przykład, przewidziane DirectiveProcessor klasy.

public override void StartProcessingRun(CodeDomProvider languageProvider, String templateContents, CompilerErrorCollection errors)
{
    //the engine has passed us the language of the text template
    //we will use that language to generate code later
    //----------------------------------------------------------
    this.codeDomProvider = languageProvider;
    this.templateContents = templateContents;
    this.errorsValue = errors;

    this.codeBuffer = new StringBuilder();
}
Public Overrides Sub StartProcessingRun(ByVal languageProvider As CodeDomProvider, ByVal templateContents As String, ByVal errors As CompilerErrorCollection)

    'the engine has passed us the language of the text template
    'we will use that language to generate code later
    '----------------------------------------------------------
    Me.codeDomProvider = languageProvider
    Me.templateContents = templateContents
    Me.errorsValue = errors

    Me.codeBuffer = New StringBuilder()
End Sub

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DirectiveProcessor Klasa

Przestrzeń nazw Microsoft.VisualStudio.TextTemplating

FinishProcessingRun

CodeDomProvider

VBCodeProvider

CSharpCodeProvider

StartProcessingRun

Inne zasoby

Tworzenie niestandardowych T4 tekst szablonu dyrektywy procesorów

Instruktaż: Tworzenie procesor dyrektywy niestandardowe