Share via


GeneratorExecutionContext.AddSource 方法

定義

多載

AddSource(String, SourceText)

SourceText將 加入至編譯

AddSource(String, String)

將 格式的 String 原始程式碼加入至編譯。

AddSource(String, SourceText)

Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs

SourceText將 加入至編譯

public void AddSource (string hintName, Microsoft.CodeAnalysis.Text.SourceText sourceText);
member this.AddSource : string * Microsoft.CodeAnalysis.Text.SourceText -> unit
Public Sub AddSource (hintName As String, sourceText As SourceText)

參數

hintName
String

可用來參考此來源文字的識別碼,在此產生器內必須是唯一的

sourceText
SourceText

SourceText要加入至編譯的

備註

hintName 允許目錄分隔符號 「/」 和 「」 ,無論主機平臺為何,它們都會正規化為 「/」。

適用於

AddSource(String, String)

Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs
Source:
GeneratorContexts.cs

將 格式的 String 原始程式碼加入至編譯。

public void AddSource (string hintName, string source);
member this.AddSource : string * string -> unit
Public Sub AddSource (hintName As String, source As String)

參數

hintName
String

可用來參考此來源文字的識別碼,在此產生器內必須是唯一的

source
String

要新增至編譯的原始程式碼

適用於