/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/VisualBasic/Impl/Options/NamingStylesOptionPage.vb
39 строк
2 KB
Cyrus Najmabadi
Organize VB imports
27 июн 2025, 21:53
27 июн 2025, 21:53
e9c47fd
Код
Авторство
О чём код?
' 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. Imports System.Runtime.InteropServices Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.Notification Imports Microsoft.VisualStudio.ComponentModelHost Imports Microsoft.VisualStudio.LanguageServices.Implementation.Options Imports Microsoft.VisualStudio.LanguageServices.Implementation.Options.Style Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options <Guid(Guids.VisualBasicOptionPageNamingStyleIdString)> Friend Class NamingStylesOptionPage Inherits AbstractOptionPage Private _grid As NamingStyleOptionPageControl Private _notificationService As INotificationService Protected Overrides Function CreateOptionPage(serviceProvider As IServiceProvider, optionStore As OptionStore) As AbstractOptionPageControl Dim componentModel = DirectCast(serviceProvider.GetService(GetType(SComponentModel)), IComponentModel) Dim workspace = componentModel.GetService(Of VisualStudioWorkspace) _notificationService = workspace.Services.GetService(Of INotificationService) _grid = New NamingStyleOptionPageControl(optionStore, _notificationService, LanguageNames.VisualBasic) Return _grid End Function Protected Overrides Sub OnApply(e As PageApplyEventArgs) If _grid.ContainsErrors() Then _notificationService.SendNotification(ServicesVSResources.Some_naming_rules_are_incomplete_Please_complete_or_remove_them) e.ApplyBehavior = ApplyKind.Cancel Return End If MyBase.OnApply(e) End Sub End Class End Namespace