ITextEditorFactoryService.CreateTextViewHost 方法

为文本视图创建宿主。

命名空间:  Microsoft.VisualStudio.Text.Editor
程序集:  Microsoft.VisualStudio.Text.UI.Wpf(在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)

语法

声明
Function CreateTextViewHost ( _
    wpfTextView As IWpfTextView, _
    setFocus As Boolean _
) As IWpfTextViewHost
IWpfTextViewHost CreateTextViewHost(
    IWpfTextView wpfTextView,
    bool setFocus
)
IWpfTextViewHost^ CreateTextViewHost(
    IWpfTextView^ wpfTextView, 
    bool setFocus
)
abstract CreateTextViewHost : 
        wpfTextView:IWpfTextView * 
        setFocus:bool -> IWpfTextViewHost
function CreateTextViewHost(
    wpfTextView : IWpfTextView, 
    setFocus : boolean
) : IWpfTextViewHost

参数

  • setFocus
    类型:Boolean

    如果 IWpfTextViewHost 在初始化之后应获得焦点,则为 true;否则为 false。

返回值

类型:Microsoft.VisualStudio.Text.Editor.IWpfTextViewHost
一个 IWpfTextViewHost

异常

异常 条件
ArgumentNullException

wpfTextView 为 nullnull 引用(在 Visual Basic 中为 Nothing)。

.NET Framework 安全性

请参阅

参考

ITextEditorFactoryService 接口

Microsoft.VisualStudio.Text.Editor 命名空间