本文整理汇总了C#中SVsServiceProvider.GetService方法的典型用法代码示例。如果您正苦于以下问题:C# SVsServiceProvider.GetService方法的具体用法?C# SVsServiceProvider.GetService怎么用?C# SVsServiceProvider.GetService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVsServiceProvider
的用法示例。
在下文中一共展示了SVsServiceProvider.GetService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VsVimHost
internal VsVimHost(
IVsAdapter adapter,
ITextBufferFactoryService textBufferFactoryService,
ITextEditorFactoryService textEditorFactoryService,
ITextDocumentFactoryService textDocumentFactoryService,
ITextBufferUndoManagerProvider undoManagerProvider,
IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
IEditorOperationsFactoryService editorOperationsFactoryService,
ISmartIndentationService smartIndentationService,
ITextManager textManager,
ISharedServiceFactory sharedServiceFactory,
IVimApplicationSettings vimApplicationSettings,
SVsServiceProvider serviceProvider)
: base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
{
_vsAdapter = adapter;
_editorAdaptersFactoryService = editorAdaptersFactoryService;
_dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
_vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
_textManager = textManager;
_sharedService = sharedServiceFactory.Create();
_vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();
_fontProperties = new TextEditorFontProperties(serviceProvider);
_vimApplicationSettings = vimApplicationSettings;
_smartIndentationService = smartIndentationService;
uint cookie;
_vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
}
示例2: VsVimHost
internal VsVimHost(
IVsAdapter adapter,
ITextBufferFactoryService textBufferFactoryService,
ITextEditorFactoryService textEditorFactoryService,
ITextDocumentFactoryService textDocumentFactoryService,
ITextBufferUndoManagerProvider undoManagerProvider,
IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
IEditorOperationsFactoryService editorOperationsFactoryService,
IWordUtilFactory wordUtilFactory,
ITextManager textManager,
ISharedServiceFactory sharedServiceFactory,
SVsServiceProvider serviceProvider)
: base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
{
_vsAdapter = adapter;
_editorAdaptersFactoryService = editorAdaptersFactoryService;
_wordUtilFactory = wordUtilFactory;
_dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
_vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
_textManager = textManager;
_sharedService = sharedServiceFactory.Create();
_vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();
uint cookie;
_vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
}
示例3: KeyBindingService
internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings)
{
_dte = serviceProvider.GetService<SDTE, _DTE>();
_vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
_optionsDialogService = service;
_protectedOperations = protectedOperations;
_vimApplicationSettings = vimApplicationSettings;
_importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet);
}
示例4: KeyBindingService
internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, IProtectedOperations protectedOperations, ILegacySettings legacySettings)
{
_dte = serviceProvider.GetService<SDTE, _DTE>();
_vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
_optionsDialogService = service;
_protectedOperations = protectedOperations;
_legacySettings = legacySettings;
_importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet);
}
示例5: VsVimHost
internal VsVimHost(
ITextBufferUndoManagerProvider undoManagerProvider,
IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
SVsServiceProvider serviceProvider)
{
_undoManagerProvider = undoManagerProvider;
_editorAdaptersFactoryService = editorAdaptersFactoryService;
_dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
_textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));
}
示例6: SaveEventsService
public SaveEventsService(
IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
ICommandHandlerServiceFactory commandHandlerServiceFactory,
SVsServiceProvider serviceProvider)
{
_editorAdaptersFactoryService = editorAdaptersFactoryService;
_commandHandlerServiceFactory = commandHandlerServiceFactory;
_runningDocumentTable = (IVsRunningDocumentTable)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
_textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));
}
示例7: FallbackKeyProcessorProvider
internal FallbackKeyProcessorProvider(SVsServiceProvider serviceProvider, IKeyUtil keyUtil, IVimApplicationSettings vimApplicationSettings, IVim vim)
{
_dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
_keyUtil = keyUtil;
_vimApplicationSettings = vimApplicationSettings;
_vim = vim;
var vsShell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
_scopeData = new ScopeData(vsShell);
}
示例8: VisualStudioDiagnosticListSuppressionStateService
public VisualStudioDiagnosticListSuppressionStateService(
SVsServiceProvider serviceProvider,
VisualStudioWorkspace workspace)
{
_workspace = workspace;
_shellService = (IVsUIShell)serviceProvider.GetService(typeof(SVsUIShell));
var errorList = serviceProvider.GetService(typeof(SVsErrorList)) as IErrorList;
_tableControl = errorList?.TableControl;
ClearState();
InitializeFromTableControlIfNeeded();
}
开发者ID:robertoenbarcelona,项目名称:roslyn,代码行数:12,代码来源:VisualStudioDiagnosticListSuppressionStateService.cs
示例9: VisualStudioMetadataAsSourceFileSupportService
public VisualStudioMetadataAsSourceFileSupportService(SVsServiceProvider serviceProvider, IMetadataAsSourceFileService metadataAsSourceFileService)
{
_metadataAsSourceFileService = metadataAsSourceFileService;
var solution = (IVsSolution)serviceProvider.GetService(typeof(SVsSolution));
ErrorHandler.ThrowOnFailure(solution.AdviseSolutionEvents(this, out _eventCookie));
}
示例10: PowerToolsUtil
internal PowerToolsUtil(SVsServiceProvider serviceProvider)
{
var vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
_isQuickFindInstalled = vsShell.IsPackageInstalled(QuickFindGuid);
_searchModel = new Lazy<object>(GetSearchModel);
_isActivePropertyInfo = new Lazy<PropertyInfo>(GetIsActivePropertyInfo);
}
示例11: ClousotOptions
public ClousotOptions(SVsServiceProvider serviceProvider) {
var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
IVsPackage package;
Marshal.ThrowExceptionForHR(shell.LoadPackage(GuidList.guidOptionsPagePackagePkg, out package));
this.page = ((OptionsPagePackage)package).GetOptionsPage();
}
示例12: DocumentMonitorService
internal DocumentMonitorService(SVsServiceProvider vsServiceProvider, ICompletionBroker completionBroker)
{
_vsServiceProvider = vsServiceProvider;
_runningDocumentTable = new RunningDocumentTable(vsServiceProvider);
_runningDocumentTable.Advise(this);
_completionBroker = completionBroker;
_dte = (DTE)vsServiceProvider.GetService(typeof(_DTE));
// NB: Resharper somehow fucks with this event, we need to do as
// little as possible in the event handler itself
var documentChanged = _changed
.ObserveOn(RxApp.TaskpoolScheduler)
.Throttle(TimeSpan.FromSeconds(2.0), RxApp.TaskpoolScheduler)
.Where(_ => !isCompletionActive())
.Select(_ => Unit.Default)
.ObserveOn(RxApp.MainThreadScheduler);
documentChanged.Subscribe(_ => SaveAll());
// NB: We use the message bus here, because we want to effectively
// merge all of the text change notifications from any document
MessageBus.Current.RegisterMessageSource(documentChanged, "AnyDocumentChanged");
checkAlreadyOpenDocuments(vsServiceProvider);
_dte.Events.WindowEvents.WindowActivated += (o,e) => _changed.OnNext(Unit.Default);
}
示例13: CommentTaskTokenSerializer
public CommentTaskTokenSerializer(SVsServiceProvider serviceProvider)
{
var tokenInfo = serviceProvider.GetService(typeof(SVsTaskList)) as IVsCommentTaskInfo;
// The SVsTaskList may not be available (e.g. during "devenv /build")
_taskTokenList = tokenInfo != null ? GetTaskTokenList(tokenInfo) : string.Empty;
}
示例14: SettingsFileUserNotifier
public SettingsFileUserNotifier(SVsServiceProvider sp, INotificationService notifier, SettingsPersister persister, SettingsLocator locator)
{
this.locator = locator;
this.notifier = notifier;
this.persister = persister;
dte = (DTE)sp.GetService(typeof(DTE));
}
示例15: RegisterSolutionEvents
private void RegisterSolutionEvents(SVsServiceProvider serviceProvider)
{
var dte = serviceProvider.GetService(typeof(SApplicationObject)) as DTE2;
var solutionEvents = dte.Events.SolutionEvents;
solutionEvents.Opened += solutionEvents_Opened;
}