Partager via


ITextEditorFactoryService.CreateTextView Method (ITextBuffer)

Creates an IWpfTextView that displays the contents of the specified text buffer.

Namespace:  Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)

Syntax

'Declaration
Function CreateTextView ( _
    textBuffer As ITextBuffer _
) As IWpfTextView
IWpfTextView CreateTextView(
    ITextBuffer textBuffer
)
IWpfTextView^ CreateTextView(
    ITextBuffer^ textBuffer
)
abstract CreateTextView : 
        textBuffer:ITextBuffer -> IWpfTextView
function CreateTextView(
    textBuffer : ITextBuffer
) : IWpfTextView

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.Editor.IWpfTextView
An IWpfTextView having all predefined text view roles.

Exceptions

Exception Condition
ArgumentNullException

textBuffer is nulla null reference (Nothing in Visual Basic).

Remarks

An ITextBuffer can be displayed in multiple views. A trivial ITextDataModel is constructed, and an ITextViewModel is constructed based on the IContentType of the textBuffer.

.NET Framework Security

See Also

Reference

ITextEditorFactoryService Interface

CreateTextView Overload

Microsoft.VisualStudio.Text.Editor Namespace