ITextBufferFactoryService.CreateTextBuffer Method (TextReader, IContentType)

Creates an ITextBuffer with the given content type and populates it by reading data from the specified text reader.

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

ITextBuffer CreateTextBuffer(
	TextReader reader,
	IContentType contentType
)

Parameters

reader
Type: System.IO.TextReader

The TextReader from which to read.

contentType
Type: Microsoft.VisualStudio.Utilities.IContentType

The contentType for the text contained in the new ITextBuffer

Return Value

Type: Microsoft.VisualStudio.Text.ITextBuffer
An ITextBuffer object with the given text reader and content type.

ExceptionCondition
ArgumentNullException

reader is null or contentType is null.

The reader is not closed by this operation. You must close the stream yourself.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft