当前位置: 首页>>代码示例>>C#>>正文


C# SVsServiceProvider.GetService方法代码示例

本文整理汇总了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);
        }
开发者ID:honeyhoneywell,项目名称:VsVim,代码行数:29,代码来源:VsVimHost.cs

示例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);
        }
开发者ID:0-F,项目名称:VsVim,代码行数:26,代码来源:VsVimHost.cs

示例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);
 }
开发者ID:rhanekom,项目名称:VsVim,代码行数:9,代码来源:KeyBindingService.cs

示例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);
 }
开发者ID:ericbock,项目名称:VsVim,代码行数:9,代码来源:KeyBindingService.cs

示例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));
 }
开发者ID:minhajuddin,项目名称:VsVim,代码行数:10,代码来源:VsVimHost.cs

示例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));
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:10,代码来源:SaveEventsService.cs

示例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);
        }
开发者ID:kun-liu,项目名称:VsVim,代码行数:10,代码来源:FallbackKeyProcessorProvider.cs

示例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));
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:VisualStudioMetadataAsSourceFileSupportService.cs

示例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);
 }
开发者ID:honeyhoneywell,项目名称:VsVim,代码行数:7,代码来源:PowerToolsUtil.cs

示例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();
    }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:7,代码来源:ClousotOptions.cs

示例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);
        }
开发者ID:hmemcpy,项目名称:SaveAllTheTime,代码行数:27,代码来源:DocumentMonitorService.cs

示例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;
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:7,代码来源:CommentTaskTokenSerializer.cs

示例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));
 }
开发者ID:yannduran,项目名称:Rebracer,代码行数:7,代码来源:SettingsFileUserNotifier.cs

示例15: RegisterSolutionEvents

        private void RegisterSolutionEvents(SVsServiceProvider serviceProvider)
        {
            var dte = serviceProvider.GetService(typeof(SApplicationObject)) as DTE2;
            var solutionEvents = dte.Events.SolutionEvents;

            solutionEvents.Opened += solutionEvents_Opened;
        }
开发者ID:XewTurquish,项目名称:vsminecraft,代码行数:7,代码来源:JavaEditorConnectionListener.cs


注:本文中的SVsServiceProvider.GetService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。