Freigeben über


ITextDocumentFactoryService.CreateAndLoadTextDocument Method (String, IContentType)

Creates an ITextDocument that opens and loads the contents of the file into a new ITextBuffer.

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

Syntax

'Declaration
Function CreateAndLoadTextDocument ( _
    filePath As String, _
    contentType As IContentType _
) As ITextDocument
ITextDocument CreateAndLoadTextDocument(
    string filePath,
    IContentType contentType
)
ITextDocument^ CreateAndLoadTextDocument(
    String^ filePath, 
    IContentType^ contentType
)
abstract CreateAndLoadTextDocument : 
        filePath:string * 
        contentType:IContentType -> ITextDocument 
function CreateAndLoadTextDocument(
    filePath : String, 
    contentType : IContentType
) : ITextDocument

Parameters

  • filePath
    Type: System.String
    The full path to the file to be loaded.

Return Value

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

Exceptions

Exception Condition
ArgumentNullException

filePath or contentType is nulla null reference (Nothing in Visual Basic).

Remarks

This method is equivalent to CreateAndLoadTextDocument(filePath, contentType, true).

.NET Framework Security

See Also

Reference

ITextDocumentFactoryService Interface

CreateAndLoadTextDocument Overload

Microsoft.VisualStudio.Text Namespace