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 contentType and populates it by reading data from the specified TextReader.

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();
public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer();
Microsoft::VisualStudio::Text::ITextBuffer CreateTextBuffer();
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer ();
abstract member CreateTextBuffer : unit -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer () As ITextBuffer

Returns

An empty ITextBuffer object.

Applies to

CreateTextBuffer(IContentType)

Creates an empty ITextBuffer with the specified IContentType.

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
Microsoft::VisualStudio::Text::ITextBuffer CreateTextBuffer(Microsoft::VisualStudio::Utilities::IContentType const & contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (contentType As IContentType) As ITextBuffer

Parameters

contentType
IContentType

The IContentType for the new ITextBuffer.

Returns

An empty ITextBuffer with the given ContentType.

Exceptions

contentType is null.

Applies to

CreateTextBuffer(TextReader, IContentType)

Creates an ITextBuffer with the given contentType and populates it by reading data from the specified TextReader.

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(System::IO::TextReader ^ reader, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (System.IO.TextReader reader, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : System.IO.TextReader * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (reader As TextReader, contentType As IContentType) As ITextBuffer

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 TextReader and contentType.

Exceptions

contentType is null.

Remarks

The reader is not closed by this operation.

Applies to

CreateTextBuffer(String, IContentType)

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

public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(System::String ^ text, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public:
 Microsoft::VisualStudio::Text::ITextBuffer ^ CreateTextBuffer(Platform::String ^ text, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
Microsoft::VisualStudio::Text::ITextBuffer CreateTextBuffer(std::wstring const & text, Microsoft::VisualStudio::Utilities::IContentType const & contentType);
public Microsoft.VisualStudio.Text.ITextBuffer CreateTextBuffer (string text, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextBuffer : string * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.ITextBuffer
Public Function CreateTextBuffer (text As String, contentType As IContentType) As ITextBuffer

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