Delen via


SourceProductionContext.AddSource Method

Definition

Overloads

AddSource(String, SourceText)

Adds a SourceText to the compilation

AddSource(String, String)

Adds source code in the form of a String to the compilation.

AddSource(String, SourceText)

Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs

Adds a SourceText to the compilation

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)

Parameters

hintName
String

An identifier that can be used to reference this source text, must be unique within this generator

sourceText
SourceText

The SourceText to add to the compilation

Remarks

Directory separators "/" and "" are allowed in hintName, they are normalized to "/" regardless of host platform.

Applies to

AddSource(String, String)

Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs
Source:
IncrementalContexts.cs

Adds source code in the form of a String to the compilation.

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

Parameters

hintName
String

An identifier that can be used to reference this source text, must be unique within this generator

source
String

The source code to add to the compilation

Applies to