Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
- contentType
Type: Microsoft.VisualStudio.Utilities.IContentType
The IContentType for the ITextBuffer.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
ITextDocumentFactoryService Interface