本文整理汇总了C#中IVsCodeWindow类的典型用法代码示例。如果您正苦于以下问题:C# IVsCodeWindow类的具体用法?C# IVsCodeWindow怎么用?C# IVsCodeWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVsCodeWindow类属于命名空间,在下文中一共展示了IVsCodeWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView, IComponentModel componentModel)
{
_window = codeWindow;
_textView = textView;
_editorOperationsFactory = componentModel.GetService<IEditorOperationsFactoryService>();
_textView.Properties.AddProperty(typeof(CodeWindowManager), this);
}
示例2: NavigationBarClient
public NavigationBarClient(
IVsDropdownBarManager manager,
IVsCodeWindow codeWindow,
IServiceProvider serviceProvider,
VisualStudioWorkspaceImpl workspace)
{
_manager = manager;
_codeWindow = codeWindow;
_workspace = workspace;
_imageService = (IVsImageService2)serviceProvider.GetService(typeof(SVsImageService));
_projectItems = SpecializedCollections.EmptyList<NavigationBarProjectItem>();
_currentTypeItems = SpecializedCollections.EmptyList<NavigationBarItem>();
var vsShell = serviceProvider.GetService(typeof(SVsShell)) as IVsShell;
if (vsShell != null)
{
object varImageList;
int hresult = vsShell.GetProperty((int)__VSSPROPID.VSSPROPID_ObjectMgrTypesImgList, out varImageList);
if (ErrorHandler.Succeeded(hresult) && varImageList != null)
{
_imageList = (IntPtr)(int)varImageList;
}
}
_codeWindowEventsSink = ComEventSink.Advise<IVsCodeWindowEvents>(codeWindow, this);
_editorAdaptersFactoryService = serviceProvider.GetMefService<IVsEditorAdaptersFactoryService>();
IVsTextView pTextView;
codeWindow.GetPrimaryView(out pTextView);
StartTrackingView(pTextView);
pTextView = null;
codeWindow.GetSecondaryView(out pTextView);
StartTrackingView(pTextView);
}
示例3: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView, IComponentModel componentModel)
{
_window = codeWindow;
_textView = textView;
_editorOperationsFactory = componentModel.GetService<IEditorOperationsFactoryService>();
_analyzer = componentModel.GetService<IPythonAnalyzer>();
}
示例4: AvaloniaDesignerPane
public AvaloniaDesignerPane(IVsCodeWindow vsCodeWindow, IVsTextLines textBuffer, string fileName, IAvaloniaDesignerSettings designerSettings)
{
_vsCodeWindow = vsCodeWindow;
_textBuffer = textBuffer.GetTextBuffer();
_fileName = fileName;
_designerSettings = designerSettings;
}
示例5: CodeWindowManager
/// <include file='doc\CodeWindowManager.uex' path='docs/doc[@for="CodeWindowManager.CodeWindowManager"]/*' />
/// <summary>
/// The CodeWindowManager is constructed by the base LanguageService class when VS calls
/// the IVsLanguageInfo.GetCodeWindowManager method. You can override CreateCodeWindowManager
/// on your LanguageService if you want to plug in a different CodeWindowManager.
/// </summary>
public CodeWindowManager(LanguageService service, IVsCodeWindow codeWindow, Source source) {
this.service = service;
this.codeWindow = codeWindow;
this.viewFilters = new ArrayList();
this.source = source;
this.properties = service.CreateDocumentProperties(this);
}
示例6: CodeWindowManager
/// <summary>
/// The CodeWindowManager is constructed by the base LanguageService class when VS calls
/// the IVsLanguageInfo.GetCodeWindowManager method. You can override CreateCodeWindowManager
/// on your LanguageService if you want to plug in a different CodeWindowManager.
/// </summary>
internal CodeWindowManager(LanguageService service, IVsCodeWindow codeWindow, ISource source) {
this.service = service;
this.codeWindow = codeWindow;
this.viewFilters = new ArrayList();
this.source = source;
#if DOCUMENT_PROPERTIES
this.properties = service.CreateDocumentProperties(this);
#endif
}
示例7: CreateCodeWindowManager
int IVsLanguageInfo.GetCodeWindowManager(IVsCodeWindow codeWindow, out IVsCodeWindowManager codeWindowManager)
{
codeWindowManager = CreateCodeWindowManager(codeWindow);
if (codeWindowManager != null)
return VSConstants.S_OK;
else
return VSConstants.E_NOTIMPL;
}
示例8: DartCodeWindowManager
public DartCodeWindowManager(ITextDocumentFactoryService textDocumentFactory, IVsEditorAdaptersFactoryService editorAdapterFactory, IVsCodeWindow codeWindow, DartAnalysisServiceFactory analysisServiceFactory)
{
this.barManager = ((IVsDropdownBarManager)codeWindow);
this.analysisServiceFactory = analysisServiceFactory;
// Figure out the filename (seriously; this is the best way?!).
IVsTextView textView;
codeWindow.GetPrimaryView(out textView);
wpfTextView = editorAdapterFactory.GetWpfTextView(textView);
textDocumentFactory.TryGetTextDocument(wpfTextView.TextBuffer, out this.textDocument);
}
示例9: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, SVsServiceProvider serviceProvider, LanguagePreferences languagePreferences)
{
Contract.Requires<ArgumentNullException>(codeWindow != null, "codeWindow");
Contract.Requires<ArgumentNullException>(serviceProvider != null, "serviceProvider");
Contract.Requires<ArgumentNullException>(languagePreferences != null, "languagePreferences");
_codeWindow = codeWindow;
_serviceProvider = serviceProvider;
_languagePreferences = languagePreferences;
_languagePreferences.PreferencesChanged += WeakEvents.AsWeak(HandleLanguagePreferencesChanged, handler => _languagePreferences.PreferencesChanged -= handler);
}
示例10: VisualGitCodeWindowManager
public VisualGitCodeWindowManager(VisualGitLanguage language, IVsCodeWindow window)
: base(language)
{
if (window == null)
throw new ArgumentNullException("window");
_window = window;
_views = new List<IVsTextView>();
if (!TryHookConnectionPoint<IVsCodeWindowEvents>(_window, this, out _cookie))
_cookie = 0;
}
示例11: VsFilterKeysAdapter
internal VsFilterKeysAdapter(
IVsFilterKeys filterKeys,
IVsCodeWindow codeWindow,
IVsAdapter vsAdapter,
IVimBuffer buffer)
{
_filterKeys = filterKeys;
_buffer = buffer;
_vsAdapter = vsAdapter;
_codeWindow = codeWindow;
_buffer.Closed += delegate { Uninstall(); };
}
示例12: GetCodeWindowManager
public int GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
{
var model = _serviceProvider.GetService(typeof(SComponentModel)) as IComponentModel;
var service = model.GetService<IVsEditorAdaptersFactoryService>();
IVsTextView textView;
if (ErrorHandler.Succeeded(pCodeWin.GetPrimaryView(out textView))) {
ppCodeWinMgr = new CodeWindowManager(pCodeWin, service.GetWpfTextView(textView), _componentModel);
return VSConstants.S_OK;
}
ppCodeWinMgr = null;
return VSConstants.E_FAIL;
}
示例13: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView)
{
_window = codeWindow;
_textView = textView;
var model = CommonPackage.ComponentModel;
var adaptersFactory = model.GetService<IVsEditorAdaptersFactoryService>();
var factory = model.GetService<IEditorOperationsFactoryService>();
EditFilter editFilter = _filter = new EditFilter(textView, factory.GetEditorOperations(textView));
var adapter = adaptersFactory.GetViewAdapter(textView);
editFilter.AttachKeyboardFilter(adapter);
var viewFilter = new TextViewFilter();
viewFilter.AttachFilter(adapter);
}
示例14: GetCodeWindowManager
public int GetCodeWindowManager(IVsCodeWindow pCodeWin, out IVsCodeWindowManager ppCodeWinMgr)
{
var adaptersFactory = _serviceProvider.GetComponentModel().GetService<IVsEditorAdaptersFactoryService>();
IVsTextLines textLines;
ErrorHandler.ThrowOnFailure(pCodeWin.GetBuffer(out textLines));
var textBuffer = adaptersFactory.GetDataBuffer(textLines);
if (textBuffer == null)
{
ppCodeWinMgr = null;
return VSConstants.E_FAIL;
}
ppCodeWinMgr = _serviceProvider.GetHlslToolsService().GetOrCreateCodeWindowManager(pCodeWin);
return VSConstants.S_OK;
}
示例15: CodeWindowManager
public CodeWindowManager(IVsCodeWindow codeWindow, SVsServiceProvider serviceProvider, Smi.VisualStudio.Language.LanguagePreferences languagePreferences)
{
//System.Diagnostics.Contracts.Contract.Requires<ArgumentNullException>(codeWindow != null, "codeWindow");
//System.Diagnostics.Contracts.Contract.Requires<ArgumentNullException>(serviceProvider != null, "serviceProvider");
//System.Diagnostics.Contracts.Contract.Requires<ArgumentNullException>(languagePreferences != null, "languagePreferences");
Action<EventHandler> unregister = null;
this._codeWindow = codeWindow;
this._serviceProvider = serviceProvider;
this._languagePreferences = languagePreferences;
if (unregister == null)
{
unregister = delegate (EventHandler handler) {
this._languagePreferences.PreferencesChanged -= handler;
};
}
this._languagePreferences.PreferencesChanged += WeakEvents.AsWeak(new EventHandler(this.HandleLanguagePreferencesChanged), unregister);
}