/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/BrokeredServices/MefServiceBrokerOfExportedServices.cs
33 строки
1 KB
Cyrus Najmabadi
Make sealed
26 мар 2025, 22:21
26 мар 2025, 22:21
d99b771
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Composition; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.VisualStudio.Shell.ServiceBroker; using Microsoft.VisualStudio.Utilities.ServiceBroker; namespace Microsoft.CodeAnalysis.LanguageServer.BrokeredServices; [Export, Shared] internal sealed class MefServiceBrokerOfExportedServices : ServiceBrokerOfExportedServices { private Task<GlobalBrokeredServiceContainer>? _containerTask; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public MefServiceBrokerOfExportedServices() { } public void SetContainer(GlobalBrokeredServiceContainer container) { _containerTask = Task.FromResult(container); } protected override Task<GlobalBrokeredServiceContainer> GetBrokeredServiceContainerAsync(CancellationToken cancellationToken) { Contract.ThrowIfNull(_containerTask, $"{nameof(SetContainer)} should have already been called."); return _containerTask; } }