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)

IWpfTextView CreateTextView(
	ITextBuffer textBuffer,
	ITextViewRoleSet roles,
	IEditorOptions parentOptions
)

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.

parentOptions
Type: Microsoft.VisualStudio.Text.Editor.IEditorOptions

The options environment for the text view.

ExceptionCondition
ArgumentNullException

textBuffer or roles or parentOptions is null.

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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft