/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/CSharp/Impl/LanguageService/CSharpOptionPageService.cs
41 строка
2 KB
Tomáš Matoušek
Revert "Revert "Update VSSDK to 18.9.496-Preview"" (#84403)
09 июл 2026, 02:44
Не верифицирован
09 июл 2026, 02:44
16f6817
Код
Авторство
О чём код?
// 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; using System.Composition; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.VisualStudio.LanguageServices.CSharp.Options.Formatting; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; namespace Microsoft.VisualStudio.LanguageServices.CSharp.LanguageService; [ExportLanguageService(typeof(IOptionPageService), LanguageNames.CSharp), Shared] internal sealed class CSharpOptionPageService : IOptionPageService { private readonly CSharpPackage _package; private readonly IThreadingContext _threadingContext; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public CSharpOptionPageService(IThreadingContext threadingContext, SVsServiceProvider serviceProvider) { var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell)); #pragma warning disable VSSDK008 // Avoid UI thread affinity in MEF Part construction; TODO: https://github.com/dotnet/roslyn/issues/84333 ErrorHandler.ThrowOnFailure(shell.LoadPackage(Guids.CSharpPackageId, out var package)); #pragma warning restore VSSDK008 // Avoid UI thread affinity in MEF Part construction _package = (CSharpPackage)package; _threadingContext = threadingContext; } public void ShowFormattingOptionPage() { _threadingContext.ThrowIfNotOnUIThread(); _package.ShowOptionPage(typeof(FormattingOptionPage)); } }