Method AddDocument
AddDocument(string, string, ProjectId, bool)
When implemented by a class, adds a new document to the project.
DocumentId AddDocument(string fileName, string text, ProjectId projectId = null, bool open = true)
Parameters
fileNamestringFile name of the
Microsoft.CodeAnalysis.Document.textstringNew
Microsoft.CodeAnalysis.Documenttext.projectIdProjectIdSpecifies Project to add document to
openboolSpecifies if document needs to be open in the workspace.
Returns
- DocumentId
Microsoft.CodeAnalysis.DocumentIdto be added.
AddDocument(string, SourceText, ProjectId, bool)
Adds a new document to the project.
DocumentId AddDocument(string fileName, SourceText text, ProjectId projectId = null, bool open = true)
Parameters
fileNamestringFile name of the
Microsoft.CodeAnalysis.Document.textSourceTextNew
Microsoft.CodeAnalysis.Documenttext.projectIdProjectIdSpecifies Project to add document to
openboolSpecifies if document needs to be open in the workspace.
Returns
- DocumentId
Microsoft.CodeAnalysis.DocumentIdto be added.