Compartir a través de


ITextBufferFactoryService.CreateTextBuffer Method (String, IContentType)

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

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

Syntax

'Declaration
Function CreateTextBuffer ( _
    text As String, _
    contentType As IContentType _
) As ITextBuffer
ITextBuffer CreateTextBuffer(
    string text,
    IContentType contentType
)
ITextBuffer^ CreateTextBuffer(
    String^ text, 
    IContentType^ contentType
)
abstract CreateTextBuffer : 
        text:string * 
        contentType:IContentType -> ITextBuffer
function CreateTextBuffer(
    text : String, 
    contentType : IContentType
) : ITextBuffer

Parameters

  • text
    Type: String

    The initial text to add.

Return Value

Type: Microsoft.VisualStudio.Text.ITextBuffer
A ITextBuffer object with the given text and IContentType.

Exceptions

Exception Condition
ArgumentNullException

Either text or contentType is nulla null reference (Nothing in Visual Basic).

.NET Framework Security

See Also

Reference

ITextBufferFactoryService Interface

CreateTextBuffer Overload

Microsoft.VisualStudio.Text Namespace