1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-22 09:15:48 +02:00

Fix unsealed classes

This commit is contained in:
chylex 2017-08-28 18:46:14 +02:00
parent 868af5ac6a
commit 40ef9a42dd
24 changed files with 25 additions and 25 deletions

View File

@ -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(){

View File

@ -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;

View File

@ -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;

View File

@ -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 _);

View File

@ -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;

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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{

View File

@ -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; }
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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
}

View File

@ -91,7 +91,7 @@ void IDisposable.Dispose(){
stream.Dispose();
}
public class Entry{
public sealed class Entry{
public string Identifier { get; }
public string KeyName{

View File

@ -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:

View File

@ -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;

View File

@ -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; }

View File

@ -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; }

View File

@ -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){

View File

@ -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){

View File

@ -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"){}

View File

@ -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{