ITextBufferFactoryService.CreateTextBuffer Method

Definition

Overloads

CreateTextBuffer()

Creates an empty ITextBuffer with IContentType "text".

CreateTextBuffer(IContentType)

Creates an empty ITextBuffer with the specified IContentType.

CreateTextBuffer(TextReader, IContentType)

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

CreateTextBuffer(String, IContentType)

Creates an ITextBuffer with the specified IContentType and populates it with the given text.

CreateTextBuffer()

Creates an empty ITextBuffer with IContentType "text".

public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer ();
Returns

An empty ITextBuffer object.

CreateTextBuffer(IContentType)

Creates an empty ITextBuffer with the specified IContentType.

public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (Microsoft.VisualStudio.Utilities.IContentType contentType);
Parameters
contentType
IContentType

The IContentType for the new ITextBuffer.

Returns

An empty ITextBuffer with the given IContentType.

Exceptions

contentType is null.

CreateTextBuffer(TextReader, IContentType)

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

public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (System.IO.TextReader reader, Microsoft.VisualStudio.Utilities.IContentType contentType);
Parameters
reader
TextReader

The TextReader from which to read.

contentType
IContentType

The contentType for the text contained in the new ITextBuffer

Returns

An ITextBuffer object with the given text reader and content type.

Exceptions

reader is null or contentType is null.

Remarks

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

CreateTextBuffer(String, IContentType)

Creates an ITextBuffer with the specified IContentType and populates it with the given text.

public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (string text, Microsoft.VisualStudio.Utilities.IContentType contentType);
Parameters
text
String

The initial text to add.

contentType
IContentType

The IContentType for the new ITextBuffer.

Returns

A ITextBuffer object with the given text and IContentType.

Exceptions

Either text or contentType is null.

Applies to