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
- languageProvider
Typ: System.CodeDom.Compiler.CodeDomProvider
Generator kodu używany do tworzenia klas generowanych transformacji.
- templateContents
Typ: System.String
Zawartość szablonu tekst, który jest przetwarzana.
- errors
Typ: System.CodeDom.Compiler.CompilerErrorCollection
Kolekcja, [directiveprocessor] można dodać błędy i ostrzeżenia, aby w razie potrzeby.
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
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Przy użyciu bibliotek z częściowo zaufanego kodu..
Zobacz też
Informacje
Przestrzeń nazw Microsoft.VisualStudio.TextTemplating
StartProcessingRun
Inne zasoby
Tworzenie niestandardowych T4 tekst szablonu dyrektywy procesorów