/// <summary> /// Initializes a new instance of the <see cref="MockAsyncServiceProvider"/> class. /// </summary> /// <param name="serviceProvider">The root of all services.</param> internal MockAsyncServiceProvider(OLE.Interop.IServiceProvider serviceProvider) { this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); this.taskSchedulerService = (IVsTaskSchedulerService)serviceProvider.QueryService(typeof(SVsTaskSchedulerService).GUID); Assumes.Present(this.taskSchedulerService); }
public IVsTextView CreateVsTextViewAdapter(OLE.Interop.IServiceProvider serviceProvider) { VsTextViewMock tv = new VsTextViewMock(); _textViewAdapters[tv.TextView] = tv; _vsTextViewAdapters[tv] = tv.TextView; return(tv); }
public IVsTextBuffer CreateVsTextBufferAdapterForSecondaryBuffer(OLE.Interop.IServiceProvider serviceProvider, ITextBuffer secondaryBuffer) { VsTextBufferMock tb = new VsTextBufferMock(secondaryBuffer); _textBufferAdapters[tb.TextBuffer] = tb; _vsTextBufferAdapters[tb] = tb.TextBuffer; return(tb); }
public IVsTextBuffer CreateVsTextBufferAdapter(OLE.Interop.IServiceProvider serviceProvider, IContentType contentType) { VsTextBufferMock tb = new VsTextBufferMock(contentType); _textBufferAdapters[tb.TextBuffer] = tb; _vsTextBufferAdapters[tb] = tb.TextBuffer; return(tb); }
int IVsEditorFactory.Close() { if (_serviceProvider != null) { _serviceProvider.Dispose(); _serviceProvider = null; } _site = null; return(VSConstants.S_OK); }
public IVsTextView CreateVsTextViewAdapter(OLE.Interop.IServiceProvider serviceProvider, ITextViewRoleSet roles) { return(CreateVsTextViewAdapter(serviceProvider)); }
public IVsCodeWindow CreateVsCodeWindowAdapter(OLE.Interop.IServiceProvider serviceProvider) { return(new VsCodeWindowMock()); }
public int GetSite(out OLE.Interop.IServiceProvider ppSP) { return(_hierarchy.GetSite(out ppSP)); }
public int SetSite(OLE.Interop.IServiceProvider psp) { return(_hierarchy.SetSite(psp)); }
int IVsEditorFactory.SetSite(OLE.Interop.IServiceProvider site) { _site = site; _serviceProvider = new ServiceProvider(_site, false); return(VSConstants.S_OK); }
public int SetSite(OLE.Interop.IServiceProvider psp) { // This never gets called return(VSConstants.S_OK); }
public int CreateToolWindow(uint grfCTW, uint dwToolWindowId, object punkTool, ref Guid rclsidTool, ref Guid rguidPersistenceSlot, ref Guid rguidAutoActivate, OLE.Interop.IServiceProvider psp, string pszCaption, int[] pfDefaultPosition, out IVsWindowFrame ppWindowFrame) { var mock = new VsWindowFrameMock(pszCaption); _frames[rguidPersistenceSlot] = mock; ppWindowFrame = mock; return(VSConstants.S_OK); }
public int CreateDocumentWindow(uint grfCDW, string pszMkDocument, IVsUIHierarchy pUIH, uint itemid, IntPtr punkDocView, IntPtr punkDocData, ref Guid rguidEditorType, string pszPhysicalView, ref Guid rguidCmdUI, OLE.Interop.IServiceProvider psp, string pszOwnerCaption, string pszEditorCaption, int[] pfDefaultPosition, out IVsWindowFrame ppWindowFrame) { throw new NotImplementedException(); }