public AbstractSnippetInfoService( Shell.SVsServiceProvider serviceProvider, Guid languageGuidForSnippets, IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners) { AssertIsForeground(); if (serviceProvider != null) { var textManager = (IVsTextManager2)serviceProvider.GetService(typeof(SVsTextManager)); if (textManager.GetExpansionManager(out _expansionManager) == VSConstants.S_OK) { ComEventSink.Advise <IVsExpansionEvents>(_expansionManager, this); _waiter = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.Snippets); _languageGuidForSnippets = languageGuidForSnippets; PopulateSnippetCaches(); } } }
public AbstractSnippetInfoService( IThreadingContext threadingContext, Shell.SVsServiceProvider serviceProvider, Guid languageGuidForSnippets, IAsynchronousOperationListenerProvider listenerProvider) : base(threadingContext) { AssertIsForeground(); if (serviceProvider != null) { var textManager = (IVsTextManager2)serviceProvider.GetService(typeof(SVsTextManager)); if (textManager.GetExpansionManager(out _expansionManager) == VSConstants.S_OK) { ComEventSink.Advise <IVsExpansionEvents>(_expansionManager, this); _waiter = listenerProvider.GetListener(FeatureAttribute.Snippets); _languageGuidForSnippets = languageGuidForSnippets; PopulateSnippetCaches(); } } }
public AbstractSnippetInfoService( Shell.SVsServiceProvider serviceProvider, Guid languageGuidForSnippets, IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners) { _languageGuidForSnippets = languageGuidForSnippets; if (serviceProvider != null) { var textManager = (IVsTextManager2)serviceProvider.GetService(typeof(SVsTextManager)); if (textManager.GetExpansionManager(out _expansionManager) == VSConstants.S_OK) { ComEventSink.Advise <IVsExpansionEvents>(_expansionManager, this); } } IAsynchronousOperationListener waiter = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.Snippets); var token = waiter.BeginAsyncOperation(GetType().Name + ".Start"); InitialCachePopulationTask = Task.Factory.StartNew(() => PopulateSnippetCaches(), CancellationToken.None, TaskCreationOptions.None, ForegroundTaskScheduler).CompletesAsyncOperation(token); }
public VisualStudioDebuggeeModuleMetadataProvider(Shell.SVsServiceProvider serviceProvider) { _componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel)); _baselineMetadata = new DebuggeeModuleInfoCache(); }