Compartilhar via


ITextDocumentFactoryService.CreateTextDocument Method

Creates an ITextDocument with textBuffer, which is to be saved to the file.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Function CreateTextDocument ( _
    textBuffer As ITextBuffer, _
    filePath As String _
) As ITextDocument
ITextDocument CreateTextDocument(
    ITextBuffer textBuffer,
    string filePath
)
ITextDocument^ CreateTextDocument(
    ITextBuffer^ textBuffer, 
    String^ filePath
)
abstract CreateTextDocument : 
        textBuffer:ITextBuffer * 
        filePath:string -> ITextDocument
function CreateTextDocument(
    textBuffer : ITextBuffer, 
    filePath : String
) : ITextDocument

Parameters

  • filePath
    Type: String

    The full path to the file.

Return Value

Type: Microsoft.VisualStudio.Text.ITextDocument
An ITextDocument.

Exceptions

Exception Condition
ArgumentNullException

textBuffer or filePath is null.

Remarks

This call does not save the contents of the buffer to the given path.

.NET Framework Security

See Also

Reference

ITextDocumentFactoryService Interface

Microsoft.VisualStudio.Text Namespace