本文整理汇总了C#中IVsEditorAdaptersFactoryService.CreateVsTextBufferAdapter方法的典型用法代码示例。如果您正苦于以下问题:C# IVsEditorAdaptersFactoryService.CreateVsTextBufferAdapter方法的具体用法?C# IVsEditorAdaptersFactoryService.CreateVsTextBufferAdapter怎么用?C# IVsEditorAdaptersFactoryService.CreateVsTextBufferAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVsEditorAdaptersFactoryService
的用法示例。
在下文中一共展示了IVsEditorAdaptersFactoryService.CreateVsTextBufferAdapter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeEditor
// ----------------------------------------------------------------------------------
/// <summary>
/// Initialize the editor
/// </summary>
// ----------------------------------------------------------------------------------
private void InitializeEditor()
{
const string message = "";
var componentModel = (IComponentModel)Microsoft.VisualStudio.Shell.Package.GetGlobalService(
typeof(SComponentModel));
_OleServiceProvider = (IServiceProvider)GetService(typeof(IServiceProvider));
_BufferFactory = componentModel.GetService<ITextBufferFactoryService>();
_EditorAdapterFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
_BufferAdapter = _EditorAdapterFactory.CreateVsTextBufferAdapter(_OleServiceProvider,
_BufferFactory.TextContentType);
_BufferAdapter.InitializeContent(message, message.Length);
_ViewAdapter = _EditorAdapterFactory.CreateVsTextViewAdapter(_OleServiceProvider);
((IVsWindowPane)_ViewAdapter).SetSite(_OleServiceProvider);
var initView = new[] { new INITVIEW() };
initView[0].fSelectionMargin = 0; // original: 0
initView[0].fWidgetMargin = 0; // original: 0
initView[0].fVirtualSpace = 0;
initView[0].fDragDropMove = 1;
initView[0].fVirtualSpace = 0;
_ViewAdapter.Initialize(_BufferAdapter as IVsTextLines, IntPtr.Zero,
(uint)TextViewInitFlags.VIF_HSCROLL |
(uint)TextViewInitFlags3.VIF_NO_HWND_SUPPORT, initView);
}