From dacb90c9bd0d1abcc1d86d36b4da3c95148627e5 Mon Sep 17 00:00:00 2001 From: Nice3point Date: Thu, 9 May 2024 01:35:10 +0300 Subject: [PATCH] Seal classes --- source/RevitLookup/Core/Diagnosers/ClockDiagnoser.cs | 2 +- source/RevitLookup/Core/Diagnosers/MemoryDiagnoser.cs | 2 +- source/RevitLookup/Core/Engine/DescriptorBuilder.Build.cs | 1 - source/RevitLookup/Models/ModuleInfo.cs | 2 +- source/RevitLookup/Models/Options/AssemblyInfo.cs | 2 +- source/RevitLookup/Models/Options/FolderLocations.cs | 2 +- .../RevitLookup/ViewModels/Dialogs/EditParameterViewModel.cs | 2 +- source/RevitLookup/ViewModels/Dialogs/ModulesViewModel.cs | 2 +- .../Controls/ContentPlaceholder/ContentPlaceholder.xaml.cs | 2 +- .../Views/Controls/DataGrid/DataGridGroupStyle.xaml.cs | 2 +- source/RevitLookup/Views/Converters/ObjectColorConverter.cs | 2 +- source/RevitLookup/Views/Dialogs/EditParameterDialog.xaml.cs | 2 +- source/RevitLookup/Views/Dialogs/ModulesDialog.xaml.cs | 2 +- source/RevitLookup/Views/Markup/MenusDictionary.cs | 2 +- source/RevitLookup/Views/Markup/StylesDictionary.cs | 2 +- .../Views/Pages/Abstraction/SnoopViewBase.Styles.cs | 4 ++-- 16 files changed, 16 insertions(+), 17 deletions(-) diff --git a/source/RevitLookup/Core/Diagnosers/ClockDiagnoser.cs b/source/RevitLookup/Core/Diagnosers/ClockDiagnoser.cs index b5f0012c..6c2dcceb 100644 --- a/source/RevitLookup/Core/Diagnosers/ClockDiagnoser.cs +++ b/source/RevitLookup/Core/Diagnosers/ClockDiagnoser.cs @@ -22,7 +22,7 @@ namespace RevitLookup.Core.Diagnosers; -public class ClockDiagnoser +public sealed class ClockDiagnoser { private readonly Stopwatch _clock = new(); diff --git a/source/RevitLookup/Core/Diagnosers/MemoryDiagnoser.cs b/source/RevitLookup/Core/Diagnosers/MemoryDiagnoser.cs index 854581d6..461de673 100644 --- a/source/RevitLookup/Core/Diagnosers/MemoryDiagnoser.cs +++ b/source/RevitLookup/Core/Diagnosers/MemoryDiagnoser.cs @@ -20,7 +20,7 @@ namespace RevitLookup.Core.Diagnosers; -public class MemoryDiagnoser +public sealed class MemoryDiagnoser { private long _initialAllocatedBytes; private long _finalAllocatedBytes; diff --git a/source/RevitLookup/Core/Engine/DescriptorBuilder.Build.cs b/source/RevitLookup/Core/Engine/DescriptorBuilder.Build.cs index 69e76a88..f4066918 100644 --- a/source/RevitLookup/Core/Engine/DescriptorBuilder.Build.cs +++ b/source/RevitLookup/Core/Engine/DescriptorBuilder.Build.cs @@ -19,7 +19,6 @@ // (Rights in Technical Data and Computer Software), as applicable. using System.Reflection; -using System.Runtime; using RevitLookup.Core.Objects; using RevitLookup.Core.Utils; diff --git a/source/RevitLookup/Models/ModuleInfo.cs b/source/RevitLookup/Models/ModuleInfo.cs index 5130b992..c57c2c3d 100644 --- a/source/RevitLookup/Models/ModuleInfo.cs +++ b/source/RevitLookup/Models/ModuleInfo.cs @@ -20,7 +20,7 @@ namespace RevitLookup.Models; -public class ModuleInfo +public sealed class ModuleInfo { public required string Name { get; set; } public required string Path { get; set; } diff --git a/source/RevitLookup/Models/Options/AssemblyInfo.cs b/source/RevitLookup/Models/Options/AssemblyInfo.cs index 4c494084..c97d68d5 100644 --- a/source/RevitLookup/Models/Options/AssemblyInfo.cs +++ b/source/RevitLookup/Models/Options/AssemblyInfo.cs @@ -20,7 +20,7 @@ namespace RevitLookup.Models.Options; -public class AssemblyInfo +public sealed class AssemblyInfo { public string Framework { get; set; } public Version AddinVersion { get; set; } diff --git a/source/RevitLookup/Models/Options/FolderLocations.cs b/source/RevitLookup/Models/Options/FolderLocations.cs index 93156c4d..9459f4a1 100644 --- a/source/RevitLookup/Models/Options/FolderLocations.cs +++ b/source/RevitLookup/Models/Options/FolderLocations.cs @@ -20,7 +20,7 @@ namespace RevitLookup.Models.Options; -public class FolderLocations +public sealed class FolderLocations { public string RootFolder { get; set; } public string ConfigFolder { get; set; } diff --git a/source/RevitLookup/ViewModels/Dialogs/EditParameterViewModel.cs b/source/RevitLookup/ViewModels/Dialogs/EditParameterViewModel.cs index cb6e6d35..1309474f 100644 --- a/source/RevitLookup/ViewModels/Dialogs/EditParameterViewModel.cs +++ b/source/RevitLookup/ViewModels/Dialogs/EditParameterViewModel.cs @@ -20,7 +20,7 @@ namespace RevitLookup.ViewModels.Dialogs; -public partial class EditParameterViewModel : ObservableObject +public sealed partial class EditParameterViewModel : ObservableObject { private readonly Parameter _parameter; diff --git a/source/RevitLookup/ViewModels/Dialogs/ModulesViewModel.cs b/source/RevitLookup/ViewModels/Dialogs/ModulesViewModel.cs index 75fa0d8d..2ac84ca3 100644 --- a/source/RevitLookup/ViewModels/Dialogs/ModulesViewModel.cs +++ b/source/RevitLookup/ViewModels/Dialogs/ModulesViewModel.cs @@ -22,7 +22,7 @@ namespace RevitLookup.ViewModels.Dialogs; -public partial class ModulesViewModel : ObservableObject +public sealed partial class ModulesViewModel : ObservableObject { [ObservableProperty] private string _searchText = string.Empty; [ObservableProperty] private List _filteredModules; diff --git a/source/RevitLookup/Views/Controls/ContentPlaceholder/ContentPlaceholder.xaml.cs b/source/RevitLookup/Views/Controls/ContentPlaceholder/ContentPlaceholder.xaml.cs index 03b0cff7..940058bb 100644 --- a/source/RevitLookup/Views/Controls/ContentPlaceholder/ContentPlaceholder.xaml.cs +++ b/source/RevitLookup/Views/Controls/ContentPlaceholder/ContentPlaceholder.xaml.cs @@ -23,7 +23,7 @@ // ReSharper disable once CheckNamespace namespace RevitLookup.Views.Controls; -public partial class ContentPlaceholder +public sealed partial class ContentPlaceholder { public static readonly DependencyProperty TextProperty = DependencyProperty.Register(nameof(Text), typeof(string), typeof(ContentPlaceholder), new PropertyMetadata(default(string))); diff --git a/source/RevitLookup/Views/Controls/DataGrid/DataGridGroupStyle.xaml.cs b/source/RevitLookup/Views/Controls/DataGrid/DataGridGroupStyle.xaml.cs index 04fa2a09..bcb117cd 100644 --- a/source/RevitLookup/Views/Controls/DataGrid/DataGridGroupStyle.xaml.cs +++ b/source/RevitLookup/Views/Controls/DataGrid/DataGridGroupStyle.xaml.cs @@ -21,7 +21,7 @@ // ReSharper disable once CheckNamespace namespace RevitLookup.Views.Controls; -public partial class DataGridGroupStyle +public sealed partial class DataGridGroupStyle { public DataGridGroupStyle() { diff --git a/source/RevitLookup/Views/Converters/ObjectColorConverter.cs b/source/RevitLookup/Views/Converters/ObjectColorConverter.cs index b4454d3b..cc7cf7b2 100644 --- a/source/RevitLookup/Views/Converters/ObjectColorConverter.cs +++ b/source/RevitLookup/Views/Converters/ObjectColorConverter.cs @@ -24,7 +24,7 @@ namespace RevitLookup.Views.Converters; -public class ObjectColorConverter : MarkupExtension, IValueConverter +public sealed class ObjectColorConverter : MarkupExtension, IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { diff --git a/source/RevitLookup/Views/Dialogs/EditParameterDialog.xaml.cs b/source/RevitLookup/Views/Dialogs/EditParameterDialog.xaml.cs index 436be3af..389f24df 100644 --- a/source/RevitLookup/Views/Dialogs/EditParameterDialog.xaml.cs +++ b/source/RevitLookup/Views/Dialogs/EditParameterDialog.xaml.cs @@ -26,7 +26,7 @@ namespace RevitLookup.Views.Dialogs; -public partial class EditParameterDialog +public sealed partial class EditParameterDialog { private readonly IServiceProvider _serviceProvider; private readonly EditParameterViewModel _viewModel; diff --git a/source/RevitLookup/Views/Dialogs/ModulesDialog.xaml.cs b/source/RevitLookup/Views/Dialogs/ModulesDialog.xaml.cs index 6e22dd34..39821a95 100644 --- a/source/RevitLookup/Views/Dialogs/ModulesDialog.xaml.cs +++ b/source/RevitLookup/Views/Dialogs/ModulesDialog.xaml.cs @@ -23,7 +23,7 @@ namespace RevitLookup.Views.Dialogs; -public partial class ModulesDialog +public sealed partial class ModulesDialog { private readonly IServiceProvider _serviceProvider; diff --git a/source/RevitLookup/Views/Markup/MenusDictionary.cs b/source/RevitLookup/Views/Markup/MenusDictionary.cs index 17ca5554..776feb85 100644 --- a/source/RevitLookup/Views/Markup/MenusDictionary.cs +++ b/source/RevitLookup/Views/Markup/MenusDictionary.cs @@ -26,7 +26,7 @@ namespace RevitLookup.Views.Markup; [Localizability(LocalizationCategory.Ignore)] [Ambient] [UsableDuringInitialization(true)] -public class MenusDictionary : ResourceDictionary +public sealed class MenusDictionary : ResourceDictionary { private const string DictionaryUri = "pack://application:,,,/RevitLookup;component/Views/Resources/Menus.xaml"; diff --git a/source/RevitLookup/Views/Markup/StylesDictionary.cs b/source/RevitLookup/Views/Markup/StylesDictionary.cs index b21f7de9..bf795cb1 100644 --- a/source/RevitLookup/Views/Markup/StylesDictionary.cs +++ b/source/RevitLookup/Views/Markup/StylesDictionary.cs @@ -26,7 +26,7 @@ namespace RevitLookup.Views.Markup; [Localizability(LocalizationCategory.Ignore)] [Ambient] [UsableDuringInitialization(true)] -public class StylesDictionary : ResourceDictionary +public sealed class StylesDictionary : ResourceDictionary { private const string DictionaryUri = "pack://application:,,,/RevitLookup;component/Views/Resources/RevitLookup.Ui.xaml"; diff --git a/source/RevitLookup/Views/Pages/Abstraction/SnoopViewBase.Styles.cs b/source/RevitLookup/Views/Pages/Abstraction/SnoopViewBase.Styles.cs index 9cff990d..68b2e7f3 100644 --- a/source/RevitLookup/Views/Pages/Abstraction/SnoopViewBase.Styles.cs +++ b/source/RevitLookup/Views/Pages/Abstraction/SnoopViewBase.Styles.cs @@ -48,7 +48,7 @@ private void SelectDataGridRowStyle(DataGridRow row) } } -public class DataGridCellStyleSelector : DataTemplateSelector +public sealed class DataGridCellStyleSelector : DataTemplateSelector { /// /// Data grid cell style selector @@ -70,7 +70,7 @@ public override DataTemplate SelectTemplate(object item, DependencyObject contai } } -public class TreeViewItemTemplateSelector : DataTemplateSelector +public sealed class TreeViewItemTemplateSelector : DataTemplateSelector { /// /// Tree view row style selector