ITextDocumentFactoryService.CreateAndLoadTextDocument Method (String, IContentType, Encoding, Boolean)

 

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)

ITextDocument CreateAndLoadTextDocument(
	string filePath,
	IContentType contentType,
	Encoding encoding,
	out bool characterSubstitutionsOccurred
)

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.

encoding
Type: System.Text.Encoding

The encoding to use. The decoder part of the Encoding object will not be used.

characterSubstitutionsOccurred
Type: System.Boolean

[out] Set to true if some of the file bytes could not be directly translated using the given encoding.

Exception Condition
ArgumentNullException

filePath, contentType, or encoding is null.

Return to top
Show: