本文整理汇总了C#中IVsEditorAdaptersFactoryService.GetWpfTextViewHost方法的典型用法代码示例。如果您正苦于以下问题:C# IVsEditorAdaptersFactoryService.GetWpfTextViewHost方法的具体用法?C# IVsEditorAdaptersFactoryService.GetWpfTextViewHost怎么用?C# IVsEditorAdaptersFactoryService.GetWpfTextViewHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVsEditorAdaptersFactoryService
的用法示例。
在下文中一共展示了IVsEditorAdaptersFactoryService.GetWpfTextViewHost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VsInteractiveWindowCommandFilter
public VsInteractiveWindowCommandFilter(IVsEditorAdaptersFactoryService adapterFactory, IInteractiveWindow window, IVsTextView textViewAdapter, IVsTextBuffer bufferAdapter, IEnumerable<Lazy<IVsInteractiveWindowOleCommandTargetProvider, ContentTypeMetadata>> oleCommandTargetProviders, IContentTypeRegistryService contentTypeRegistry)
{
_window = window;
_oleCommandTargetProviders = oleCommandTargetProviders;
_contentTypeRegistry = contentTypeRegistry;
this.textViewAdapter = textViewAdapter;
// make us a code window so we'll have the same colors as a normal code window.
IVsTextEditorPropertyContainer propContainer;
ErrorHandler.ThrowOnFailure(((IVsTextEditorPropertyCategoryContainer)textViewAdapter).GetPropertyCategory(Microsoft.VisualStudio.Editor.DefGuidList.guidEditPropCategoryViewMasterSettings, out propContainer));
propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewComposite_AllCodeWindowDefaults, true);
propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewGlobalOpt_AutoScrollCaretOnTextEntry, true);
// editor services are initialized in textViewAdapter.Initialize - hook underneath them:
_preEditorCommandFilter = new CommandFilter(this, CommandFilterLayer.PreEditor);
ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(_preEditorCommandFilter, out _editorCommandFilter));
textViewAdapter.Initialize(
(IVsTextLines)bufferAdapter,
IntPtr.Zero,
(uint)TextViewInitFlags.VIF_HSCROLL | (uint)TextViewInitFlags.VIF_VSCROLL | (uint)TextViewInitFlags3.VIF_NO_HWND_SUPPORT,
new[] { new INITVIEW { fSelectionMargin = 0, fWidgetMargin = 0, fVirtualSpace = 0, fDragDropMove = 1 } });
// disable change tracking because everything will be changed
var textViewHost = adapterFactory.GetWpfTextViewHost(textViewAdapter);
_preLanguageCommandFilter = new CommandFilter(this, CommandFilterLayer.PreLanguage);
ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(_preLanguageCommandFilter, out _editorServicesCommandFilter));
_textViewHost = textViewHost;
}