ITextEditorFactoryService.CreateTextView Method (ITextBuffer, ITextViewRoleSet, IEditorOptions)

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

声明
Function CreateTextView ( _
    textBuffer As ITextBuffer, _
    roles As ITextViewRoleSet, _
    parentOptions As IEditorOptions _
) As IWpfTextView
IWpfTextView CreateTextView(
    ITextBuffer textBuffer,
    ITextViewRoleSet roles,
    IEditorOptions parentOptions
)
IWpfTextView^ CreateTextView(
    ITextBuffer^ textBuffer, 
    ITextViewRoleSet^ roles, 
    IEditorOptions^ parentOptions
)
abstract CreateTextView : 
        textBuffer:ITextBuffer * 
        roles:ITextViewRoleSet * 
        parentOptions:IEditorOptions -> IWpfTextView 
function CreateTextView(
    textBuffer : ITextBuffer, 
    roles : ITextViewRoleSet, 
    parentOptions : IEditorOptions
) : IWpfTextView

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.Editor.IWpfTextView
An IWpfTextView.

Exceptions

Exception Condition
ArgumentNullException

textBuffer or roles or parentOptions is null.

Remarks

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

.NET Framework Security

See Also

Reference

ITextEditorFactoryService Interface

CreateTextView Overload

Microsoft.VisualStudio.Text.Editor Namespace