1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-30 23:34:09 +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; using System.Windows.Forms;
namespace TweetDuck.Core.Controls{ namespace TweetDuck.Core.Controls{
class FlatButton : Button{ sealed class FlatButton : Button{
protected override bool ShowFocusCues => false; protected override bool ShowFocusCues => false;
public FlatButton(){ public FlatButton(){

View File

@ -5,7 +5,7 @@
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Core.Handling{
class ContextMenuBrowser : ContextMenuBase{ sealed class ContextMenuBrowser : ContextMenuBase{
private const CefMenuCommand MenuGlobal = (CefMenuCommand)26600; private const CefMenuCommand MenuGlobal = (CefMenuCommand)26600;
private const CefMenuCommand MenuMute = (CefMenuCommand)26601; private const CefMenuCommand MenuMute = (CefMenuCommand)26601;
private const CefMenuCommand MenuSettings = (CefMenuCommand)26602; private const CefMenuCommand MenuSettings = (CefMenuCommand)26602;

View File

@ -3,7 +3,7 @@
using TweetDuck.Core.Notification; using TweetDuck.Core.Notification;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Core.Handling{
class ContextMenuNotification : ContextMenuBase{ sealed class ContextMenuNotification : ContextMenuBase{
private const CefMenuCommand MenuViewDetail = (CefMenuCommand)26600; private const CefMenuCommand MenuViewDetail = (CefMenuCommand)26600;
private const CefMenuCommand MenuSkipTweet = (CefMenuCommand)26601; private const CefMenuCommand MenuSkipTweet = (CefMenuCommand)26601;
private const CefMenuCommand MenuFreeze = (CefMenuCommand)26602; private const CefMenuCommand MenuFreeze = (CefMenuCommand)26602;

View File

@ -2,7 +2,7 @@
using CefSharp; using CefSharp;
namespace TweetDuck.Core.Handling.General{ namespace TweetDuck.Core.Handling.General{
class BrowserProcessHandler : IBrowserProcessHandler{ sealed class BrowserProcessHandler : IBrowserProcessHandler{
void IBrowserProcessHandler.OnContextInitialized(){ void IBrowserProcessHandler.OnContextInitialized(){
using(IRequestContext ctx = Cef.GetGlobalRequestContext()){ using(IRequestContext ctx = Cef.GetGlobalRequestContext()){
ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _); ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _);

View File

@ -7,7 +7,7 @@
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
namespace TweetDuck.Core.Handling.General{ 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){ bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage){
((ChromiumWebBrowser)browserControl).InvokeSafe(() => { ((ChromiumWebBrowser)browserControl).InvokeSafe(() => {
FormMessage form; FormMessage form;

View File

@ -2,7 +2,7 @@
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
namespace TweetDuck.Core.Handling.General{ 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){ 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; newBrowser = null;

View File

@ -2,7 +2,7 @@
using TweetDuck.Core.Handling.General; using TweetDuck.Core.Handling.General;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Core.Handling{
class RequestHandlerBrowser : RequestHandlerBase{ sealed class RequestHandlerBrowser : RequestHandlerBase{
public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){ public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){
browser.Reload(); browser.Reload();
} }

View File

@ -4,7 +4,7 @@
using System.Text; using System.Text;
namespace TweetDuck.Core.Handling{ namespace TweetDuck.Core.Handling{
class ResourceHandlerNotification : IResourceHandler{ sealed class ResourceHandlerNotification : IResourceHandler{
private readonly NameValueCollection headers = new NameValueCollection(0); private readonly NameValueCollection headers = new NameValueCollection(0);
private MemoryStream dataIn; private MemoryStream dataIn;

View File

@ -139,7 +139,7 @@ private void control_MouseWheel(object sender, MouseEventArgs e){
panelContents.Focus(); panelContents.Focus();
} }
private class SettingsTab{ private sealed class SettingsTab{
public Button Button { get; } public Button Button { get; }
public BaseTabSettings Control{ public BaseTabSettings Control{

View File

@ -176,7 +176,7 @@ private static IEnumerable<PathInfo> EnumerateFilesRelative(string root){
}) : Enumerable.Empty<PathInfo>(); }) : Enumerable.Empty<PathInfo>();
} }
private class PathInfo{ private sealed class PathInfo{
public string Full { get; set; } public string Full { get; set; }
public string Relative { get; set; } public string Relative { get; set; }
} }

View File

@ -7,7 +7,7 @@
using TweetDuck.Core.Utils; using TweetDuck.Core.Utils;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Core.Other.Settings{
partial class TabSettingsAdvanced : BaseTabSettings{ sealed partial class TabSettingsAdvanced : BaseTabSettings{
private static SystemConfig SysConfig => Program.SystemConfig; private static SystemConfig SysConfig => Program.SystemConfig;
private readonly Action<string> reinjectBrowserCSS; private readonly Action<string> reinjectBrowserCSS;

View File

@ -3,7 +3,7 @@
using TweetDuck.Updates; using TweetDuck.Updates;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Core.Other.Settings{
partial class TabSettingsGeneral : BaseTabSettings{ sealed partial class TabSettingsGeneral : BaseTabSettings{
private readonly UpdateHandler updates; private readonly UpdateHandler updates;
private int updateCheckEventId = -1; private int updateCheckEventId = -1;

View File

@ -4,7 +4,7 @@
using TweetDuck.Core.Notification; using TweetDuck.Core.Notification;
namespace TweetDuck.Core.Other.Settings{ 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 static readonly int[] IdlePauseSeconds = { 0, 30, 60, 120, 300 };
private readonly FormNotificationMain notification; private readonly FormNotificationMain notification;

View File

@ -7,7 +7,7 @@
using TweetLib.Audio; using TweetLib.Audio;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Core.Other.Settings{
partial class TabSettingsSounds : BaseTabSettings{ sealed partial class TabSettingsSounds : BaseTabSettings{
private readonly SoundNotification soundNotification; private readonly SoundNotification soundNotification;
private readonly bool supportsChangingVolume; private readonly bool supportsChangingVolume;

View File

@ -3,7 +3,7 @@
using System.Windows.Forms; using System.Windows.Forms;
namespace TweetDuck.Core{ namespace TweetDuck.Core{
partial class TrayIcon : Component{ sealed partial class TrayIcon : Component{
public enum Behavior{ // keep order public enum Behavior{ // keep order
Disabled, DisplayOnly, MinimizeToTray, CloseToTray, Combined Disabled, DisplayOnly, MinimizeToTray, CloseToTray, Combined
} }

View File

@ -91,7 +91,7 @@ void IDisposable.Dispose(){
stream.Dispose(); stream.Dispose();
} }
public class Entry{ public sealed class Entry{
public string Identifier { get; } public string Identifier { get; }
public string KeyName{ 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){ bool ITypeConverter.TryWriteType(Type type, object value, out string converted){
switch(Type.GetTypeCode(type)){ switch(Type.GetTypeCode(type)){
case TypeCode.Boolean: case TypeCode.Boolean:

View File

@ -8,7 +8,7 @@
using TweetDuck.Plugins.Enums; using TweetDuck.Plugins.Enums;
namespace TweetDuck.Plugins.Controls{ namespace TweetDuck.Plugins.Controls{
partial class PluginControl : UserControl{ sealed partial class PluginControl : UserControl{
private readonly PluginManager pluginManager; private readonly PluginManager pluginManager;
private readonly Plugin plugin; private readonly Plugin plugin;

View File

@ -1,7 +1,7 @@
using System; using System;
namespace TweetDuck.Plugins.Events{ namespace TweetDuck.Plugins.Events{
class PluginChangedStateEventArgs : EventArgs{ sealed class PluginChangedStateEventArgs : EventArgs{
public Plugin Plugin { get; } public Plugin Plugin { get; }
public bool IsEnabled { get; } public bool IsEnabled { get; }

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace TweetDuck.Plugins.Events{ namespace TweetDuck.Plugins.Events{
class PluginErrorEventArgs : EventArgs{ sealed class PluginErrorEventArgs : EventArgs{
public bool HasErrors => Errors.Count > 0; public bool HasErrors => Errors.Count > 0;
public IList<string> Errors { get; } public IList<string> Errors { get; }

View File

@ -93,7 +93,7 @@ private void TriggerCheckFinishedEvent(UpdateEventArgs args){
CheckFinished?.Invoke(this, args); CheckFinished?.Invoke(this, args);
} }
public class Bridge{ public sealed class Bridge{
private readonly UpdateHandler owner; private readonly UpdateHandler owner;
public Bridge(UpdateHandler owner){ public Bridge(UpdateHandler owner){

View File

@ -20,7 +20,7 @@ private static int Main(string[] args){
else return SubProcess.ExecuteProcess(); else return SubProcess.ExecuteProcess();
} }
private class RendererProcess : SubProcess{ private sealed class RendererProcess : SubProcess{
public RendererProcess(string[] args) : base(args){} public RendererProcess(string[] args) : base(args){}
public override void OnBrowserCreated(CefBrowserWrapper wrapper){ public override void OnBrowserCreated(CefBrowserWrapper wrapper){

View File

@ -5,7 +5,7 @@
namespace TweetDuck.Video.Controls{ namespace TweetDuck.Video.Controls{
[DesignTimeVisible(true)] [DesignTimeVisible(true)]
[Clsid("{6bf52a52-394a-11d3-b153-00c04f79faa6}")] [Clsid("{6bf52a52-394a-11d3-b153-00c04f79faa6}")]
class ControlWMP : AxHost{ sealed class ControlWMP : AxHost{
public WindowsMediaPlayer Ocx { get; private set; } public WindowsMediaPlayer Ocx { get; private set; }
public ControlWMP() : base("6bf52a52-394a-11d3-b153-00c04f79faa6"){} public ControlWMP() : base("6bf52a52-394a-11d3-b153-00c04f79faa6"){}

View File

@ -8,7 +8,7 @@
using WMPLib; using WMPLib;
namespace TweetDuck.Video{ namespace TweetDuck.Video{
partial class FormPlayer : Form{ sealed partial class FormPlayer : Form{
protected override bool ShowWithoutActivation => true; protected override bool ShowWithoutActivation => true;
private readonly IntPtr ownerHandle; private readonly IntPtr ownerHandle;
@ -258,7 +258,7 @@ private void StopVideo(){
Close(); Close();
} }
internal class MessageFilter : IMessageFilter{ internal sealed class MessageFilter : IMessageFilter{
private readonly FormPlayer form; private readonly FormPlayer form;
private bool IsCursorOverVideo{ private bool IsCursorOverVideo{