ITextEditorFactoryService.CreateTextView Method (ITextBuffer, ITextViewRoleSet)
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 _
) As IWpfTextView
IWpfTextView CreateTextView(
ITextBuffer textBuffer,
ITextViewRoleSet roles
)
IWpfTextView^ CreateTextView(
ITextBuffer^ textBuffer,
ITextViewRoleSet^ roles
)
abstract CreateTextView :
textBuffer:ITextBuffer *
roles:ITextViewRoleSet -> IWpfTextView
function CreateTextView(
textBuffer : ITextBuffer,
roles : ITextViewRoleSet
) : IWpfTextView
Parameters
- textBuffer
Type: Microsoft.VisualStudio.Text.ITextBuffer
The ITextBuffer that provides the text for the view.
- roles
Type: Microsoft.VisualStudio.Text.Editor.ITextViewRoleSet
The set of roles filled by the view.
Return Value
Type: Microsoft.VisualStudio.Text.Editor.IWpfTextView
An IWpfTextView.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | textBuffer or roles 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 and the roles.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.