diff --git a/Core/Controls/FlatButton.cs b/Core/Controls/FlatButton.cs index 6695de85..45dedbde 100644 --- a/Core/Controls/FlatButton.cs +++ b/Core/Controls/FlatButton.cs @@ -2,7 +2,7 @@ using System.Windows.Forms; namespace TweetDuck.Core.Controls{ - class FlatButton : Button{ + sealed class FlatButton : Button{ protected override bool ShowFocusCues => false; public FlatButton(){ diff --git a/Core/Handling/ContextMenuBrowser.cs b/Core/Handling/ContextMenuBrowser.cs index fed0e03e..ba204c82 100644 --- a/Core/Handling/ContextMenuBrowser.cs +++ b/Core/Handling/ContextMenuBrowser.cs @@ -5,7 +5,7 @@ using TweetDuck.Core.Utils; namespace TweetDuck.Core.Handling{ - class ContextMenuBrowser : ContextMenuBase{ + sealed class ContextMenuBrowser : ContextMenuBase{ private const CefMenuCommand MenuGlobal = (CefMenuCommand)26600; private const CefMenuCommand MenuMute = (CefMenuCommand)26601; private const CefMenuCommand MenuSettings = (CefMenuCommand)26602; diff --git a/Core/Handling/ContextMenuNotification.cs b/Core/Handling/ContextMenuNotification.cs index e9c42921..62c6b6c5 100644 --- a/Core/Handling/ContextMenuNotification.cs +++ b/Core/Handling/ContextMenuNotification.cs @@ -3,7 +3,7 @@ using TweetDuck.Core.Notification; namespace TweetDuck.Core.Handling{ - class ContextMenuNotification : ContextMenuBase{ + sealed class ContextMenuNotification : ContextMenuBase{ private const CefMenuCommand MenuViewDetail = (CefMenuCommand)26600; private const CefMenuCommand MenuSkipTweet = (CefMenuCommand)26601; private const CefMenuCommand MenuFreeze = (CefMenuCommand)26602; diff --git a/Core/Handling/General/BrowserProcessHandler.cs b/Core/Handling/General/BrowserProcessHandler.cs index bee3bc0d..7c4dc1b0 100644 --- a/Core/Handling/General/BrowserProcessHandler.cs +++ b/Core/Handling/General/BrowserProcessHandler.cs @@ -2,7 +2,7 @@ using CefSharp; namespace TweetDuck.Core.Handling.General{ - class BrowserProcessHandler : IBrowserProcessHandler{ + sealed class BrowserProcessHandler : IBrowserProcessHandler{ void IBrowserProcessHandler.OnContextInitialized(){ using(IRequestContext ctx = Cef.GetGlobalRequestContext()){ ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _); diff --git a/Core/Handling/General/JavaScriptDialogHandler.cs b/Core/Handling/General/JavaScriptDialogHandler.cs index f90e04a0..1ce5540f 100644 --- a/Core/Handling/General/JavaScriptDialogHandler.cs +++ b/Core/Handling/General/JavaScriptDialogHandler.cs @@ -7,7 +7,7 @@ using TweetDuck.Core.Utils; namespace TweetDuck.Core.Handling.General{ - class JavaScriptDialogHandler : IJsDialogHandler{ + sealed class JavaScriptDialogHandler : IJsDialogHandler{ bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage){ ((ChromiumWebBrowser)browserControl).InvokeSafe(() => { FormMessage form; diff --git a/Core/Handling/General/LifeSpanHandler.cs b/Core/Handling/General/LifeSpanHandler.cs index b0abf7f5..14dfe921 100644 --- a/Core/Handling/General/LifeSpanHandler.cs +++ b/Core/Handling/General/LifeSpanHandler.cs @@ -2,7 +2,7 @@ using TweetDuck.Core.Utils; namespace TweetDuck.Core.Handling.General{ - class LifeSpanHandler : ILifeSpanHandler{ + sealed class LifeSpanHandler : ILifeSpanHandler{ public bool OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser){ newBrowser = null; diff --git a/Core/Handling/RequestHandlerBrowser.cs b/Core/Handling/RequestHandlerBrowser.cs index 371ac8c7..ad8d8a5d 100644 --- a/Core/Handling/RequestHandlerBrowser.cs +++ b/Core/Handling/RequestHandlerBrowser.cs @@ -2,7 +2,7 @@ using TweetDuck.Core.Handling.General; namespace TweetDuck.Core.Handling{ - class RequestHandlerBrowser : RequestHandlerBase{ + sealed class RequestHandlerBrowser : RequestHandlerBase{ public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){ browser.Reload(); } diff --git a/Core/Handling/ResourceHandlerNotification.cs b/Core/Handling/ResourceHandlerNotification.cs index 029dc19b..53114301 100644 --- a/Core/Handling/ResourceHandlerNotification.cs +++ b/Core/Handling/ResourceHandlerNotification.cs @@ -4,7 +4,7 @@ using System.Text; namespace TweetDuck.Core.Handling{ - class ResourceHandlerNotification : IResourceHandler{ + sealed class ResourceHandlerNotification : IResourceHandler{ private readonly NameValueCollection headers = new NameValueCollection(0); private MemoryStream dataIn; diff --git a/Core/Other/FormSettings.cs b/Core/Other/FormSettings.cs index d2985577..663afcf9 100644 --- a/Core/Other/FormSettings.cs +++ b/Core/Other/FormSettings.cs @@ -139,7 +139,7 @@ private void control_MouseWheel(object sender, MouseEventArgs e){ panelContents.Focus(); } - private class SettingsTab{ + private sealed class SettingsTab{ public Button Button { get; } public BaseTabSettings Control{ diff --git a/Core/Other/Settings/Export/ExportManager.cs b/Core/Other/Settings/Export/ExportManager.cs index e1b8b37d..eb560ab1 100644 --- a/Core/Other/Settings/Export/ExportManager.cs +++ b/Core/Other/Settings/Export/ExportManager.cs @@ -176,7 +176,7 @@ private static IEnumerable<PathInfo> EnumerateFilesRelative(string root){ }) : Enumerable.Empty<PathInfo>(); } - private class PathInfo{ + private sealed class PathInfo{ public string Full { get; set; } public string Relative { get; set; } } diff --git a/Core/Other/Settings/TabSettingsAdvanced.cs b/Core/Other/Settings/TabSettingsAdvanced.cs index 83756557..503f3969 100644 --- a/Core/Other/Settings/TabSettingsAdvanced.cs +++ b/Core/Other/Settings/TabSettingsAdvanced.cs @@ -7,7 +7,7 @@ using TweetDuck.Core.Utils; namespace TweetDuck.Core.Other.Settings{ - partial class TabSettingsAdvanced : BaseTabSettings{ + sealed partial class TabSettingsAdvanced : BaseTabSettings{ private static SystemConfig SysConfig => Program.SystemConfig; private readonly Action<string> reinjectBrowserCSS; diff --git a/Core/Other/Settings/TabSettingsGeneral.cs b/Core/Other/Settings/TabSettingsGeneral.cs index 1ff28343..ea18cf69 100644 --- a/Core/Other/Settings/TabSettingsGeneral.cs +++ b/Core/Other/Settings/TabSettingsGeneral.cs @@ -3,7 +3,7 @@ using TweetDuck.Updates; namespace TweetDuck.Core.Other.Settings{ - partial class TabSettingsGeneral : BaseTabSettings{ + sealed partial class TabSettingsGeneral : BaseTabSettings{ private readonly UpdateHandler updates; private int updateCheckEventId = -1; diff --git a/Core/Other/Settings/TabSettingsNotifications.cs b/Core/Other/Settings/TabSettingsNotifications.cs index b5a081f0..a69d72d7 100644 --- a/Core/Other/Settings/TabSettingsNotifications.cs +++ b/Core/Other/Settings/TabSettingsNotifications.cs @@ -4,7 +4,7 @@ using TweetDuck.Core.Notification; namespace TweetDuck.Core.Other.Settings{ - partial class TabSettingsNotifications : BaseTabSettings{ + sealed partial class TabSettingsNotifications : BaseTabSettings{ private static readonly int[] IdlePauseSeconds = { 0, 30, 60, 120, 300 }; private readonly FormNotificationMain notification; diff --git a/Core/Other/Settings/TabSettingsSounds.cs b/Core/Other/Settings/TabSettingsSounds.cs index fc6534ce..4eac08f7 100644 --- a/Core/Other/Settings/TabSettingsSounds.cs +++ b/Core/Other/Settings/TabSettingsSounds.cs @@ -7,7 +7,7 @@ using TweetLib.Audio; namespace TweetDuck.Core.Other.Settings{ - partial class TabSettingsSounds : BaseTabSettings{ + sealed partial class TabSettingsSounds : BaseTabSettings{ private readonly SoundNotification soundNotification; private readonly bool supportsChangingVolume; diff --git a/Core/TrayIcon.cs b/Core/TrayIcon.cs index 54ed17a1..a40c5d3c 100644 --- a/Core/TrayIcon.cs +++ b/Core/TrayIcon.cs @@ -3,7 +3,7 @@ using System.Windows.Forms; namespace TweetDuck.Core{ - partial class TrayIcon : Component{ + sealed partial class TrayIcon : Component{ public enum Behavior{ // keep order Disabled, DisplayOnly, MinimizeToTray, CloseToTray, Combined } diff --git a/Data/CombinedFileStream.cs b/Data/CombinedFileStream.cs index 2b4b47a3..94f4880b 100644 --- a/Data/CombinedFileStream.cs +++ b/Data/CombinedFileStream.cs @@ -91,7 +91,7 @@ void IDisposable.Dispose(){ stream.Dispose(); } - public class Entry{ + public sealed class Entry{ public string Identifier { get; } public string KeyName{ diff --git a/Data/Serialization/FileSerializer.cs b/Data/Serialization/FileSerializer.cs index b0a5736b..ddb66164 100644 --- a/Data/Serialization/FileSerializer.cs +++ b/Data/Serialization/FileSerializer.cs @@ -95,7 +95,7 @@ public void Read(string file, T obj){ } } - private class BasicTypeConverter : ITypeConverter{ + private sealed class BasicTypeConverter : ITypeConverter{ bool ITypeConverter.TryWriteType(Type type, object value, out string converted){ switch(Type.GetTypeCode(type)){ case TypeCode.Boolean: diff --git a/Plugins/Controls/PluginControl.cs b/Plugins/Controls/PluginControl.cs index fb61842c..bbcb4d80 100644 --- a/Plugins/Controls/PluginControl.cs +++ b/Plugins/Controls/PluginControl.cs @@ -8,7 +8,7 @@ using TweetDuck.Plugins.Enums; namespace TweetDuck.Plugins.Controls{ - partial class PluginControl : UserControl{ + sealed partial class PluginControl : UserControl{ private readonly PluginManager pluginManager; private readonly Plugin plugin; diff --git a/Plugins/Events/PluginChangedStateEventArgs.cs b/Plugins/Events/PluginChangedStateEventArgs.cs index 21bbfe79..5d643c23 100644 --- a/Plugins/Events/PluginChangedStateEventArgs.cs +++ b/Plugins/Events/PluginChangedStateEventArgs.cs @@ -1,7 +1,7 @@ using System; namespace TweetDuck.Plugins.Events{ - class PluginChangedStateEventArgs : EventArgs{ + sealed class PluginChangedStateEventArgs : EventArgs{ public Plugin Plugin { get; } public bool IsEnabled { get; } diff --git a/Plugins/Events/PluginErrorEventArgs.cs b/Plugins/Events/PluginErrorEventArgs.cs index e9e31766..57fb7bff 100644 --- a/Plugins/Events/PluginErrorEventArgs.cs +++ b/Plugins/Events/PluginErrorEventArgs.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; namespace TweetDuck.Plugins.Events{ - class PluginErrorEventArgs : EventArgs{ + sealed class PluginErrorEventArgs : EventArgs{ public bool HasErrors => Errors.Count > 0; public IList<string> Errors { get; } diff --git a/Updates/UpdateHandler.cs b/Updates/UpdateHandler.cs index e05942ce..55960396 100644 --- a/Updates/UpdateHandler.cs +++ b/Updates/UpdateHandler.cs @@ -93,7 +93,7 @@ private void TriggerCheckFinishedEvent(UpdateEventArgs args){ CheckFinished?.Invoke(this, args); } - public class Bridge{ + public sealed class Bridge{ private readonly UpdateHandler owner; public Bridge(UpdateHandler owner){ diff --git a/subprocess/Program.cs b/subprocess/Program.cs index ddc61cc4..03f6b8c7 100644 --- a/subprocess/Program.cs +++ b/subprocess/Program.cs @@ -20,7 +20,7 @@ private static int Main(string[] args){ else return SubProcess.ExecuteProcess(); } - private class RendererProcess : SubProcess{ + private sealed class RendererProcess : SubProcess{ public RendererProcess(string[] args) : base(args){} public override void OnBrowserCreated(CefBrowserWrapper wrapper){ diff --git a/video/Controls/ControlWMP.cs b/video/Controls/ControlWMP.cs index 620ee5ba..ef985286 100644 --- a/video/Controls/ControlWMP.cs +++ b/video/Controls/ControlWMP.cs @@ -5,7 +5,7 @@ namespace TweetDuck.Video.Controls{ [DesignTimeVisible(true)] [Clsid("{6bf52a52-394a-11d3-b153-00c04f79faa6}")] - class ControlWMP : AxHost{ + sealed class ControlWMP : AxHost{ public WindowsMediaPlayer Ocx { get; private set; } public ControlWMP() : base("6bf52a52-394a-11d3-b153-00c04f79faa6"){} diff --git a/video/FormPlayer.cs b/video/FormPlayer.cs index 9d85c7e3..e3fc98e0 100644 --- a/video/FormPlayer.cs +++ b/video/FormPlayer.cs @@ -8,7 +8,7 @@ using WMPLib; namespace TweetDuck.Video{ - partial class FormPlayer : Form{ + sealed partial class FormPlayer : Form{ protected override bool ShowWithoutActivation => true; private readonly IntPtr ownerHandle; @@ -258,7 +258,7 @@ private void StopVideo(){ Close(); } - internal class MessageFilter : IMessageFilter{ + internal sealed class MessageFilter : IMessageFilter{ private readonly FormPlayer form; private bool IsCursorOverVideo{