diff --git a/Impl/LockHandler.cs b/Application/LockHandler.cs similarity index 97% rename from Impl/LockHandler.cs rename to Application/LockHandler.cs index d25630db..fb768a00 100644 --- a/Impl/LockHandler.cs +++ b/Application/LockHandler.cs @@ -1,10 +1,10 @@ using System; using System.ComponentModel; using System.Diagnostics; -using TweetDuck.Core.Utils; +using TweetDuck.Utils; using TweetLib.Core.Application; -namespace TweetDuck.Impl{ +namespace TweetDuck.Application{ class LockHandler : IAppLockHandler{ private const int WaitRetryDelay = 250; private const int RestoreFailTimeout = 2000; diff --git a/Impl/SystemHandler.cs b/Application/SystemHandler.cs similarity index 93% rename from Impl/SystemHandler.cs rename to Application/SystemHandler.cs index e81def3d..4daef5be 100644 --- a/Impl/SystemHandler.cs +++ b/Application/SystemHandler.cs @@ -2,7 +2,7 @@ using System.IO; using TweetLib.Core.Application; -namespace TweetDuck.Impl{ +namespace TweetDuck.Application{ class SystemHandler : IAppSystemHandler{ void IAppSystemHandler.OpenFileExplorer(string path){ if (File.Exists(path)){ diff --git a/Core/Adapters/CefScriptExecutor.cs b/Browser/Adapters/CefScriptExecutor.cs similarity index 97% rename from Core/Adapters/CefScriptExecutor.cs rename to Browser/Adapters/CefScriptExecutor.cs index 49a06b9c..d955af7d 100644 --- a/Core/Adapters/CefScriptExecutor.cs +++ b/Browser/Adapters/CefScriptExecutor.cs @@ -2,7 +2,7 @@ using CefSharp; using TweetLib.Core.Browser; -namespace TweetDuck.Core.Adapters{ +namespace TweetDuck.Browser.Adapters{ sealed class CefScriptExecutor : IScriptExecutor{ private readonly IWebBrowser browser; diff --git a/Core/Bridge/PropertyBridge.cs b/Browser/Bridge/PropertyBridge.cs similarity index 98% rename from Core/Bridge/PropertyBridge.cs rename to Browser/Bridge/PropertyBridge.cs index aa543181..69f17e6c 100644 --- a/Core/Bridge/PropertyBridge.cs +++ b/Browser/Bridge/PropertyBridge.cs @@ -3,7 +3,7 @@ using TweetLib.Core; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Bridge{ +namespace TweetDuck.Browser.Bridge{ static class PropertyBridge{ public enum Environment{ Browser, Notification diff --git a/Core/Bridge/TweetDeckBridge.cs b/Browser/Bridge/TweetDeckBridge.cs similarity index 96% rename from Core/Bridge/TweetDeckBridge.cs rename to Browser/Bridge/TweetDeckBridge.cs index cc52e34f..bfbe2089 100644 --- a/Core/Bridge/TweetDeckBridge.cs +++ b/Browser/Bridge/TweetDeckBridge.cs @@ -1,14 +1,14 @@ using System.Diagnostics.CodeAnalysis; using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Notification; -using TweetDuck.Core.Other; -using TweetDuck.Core.Utils; +using TweetDuck.Browser.Handling; +using TweetDuck.Browser.Notification; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Utils; using TweetLib.Core.Features.Notifications; -namespace TweetDuck.Core.Bridge{ +namespace TweetDuck.Browser.Bridge{ [SuppressMessage("ReSharper", "UnusedMember.Global")] class TweetDeckBridge{ public static void ResetStaticProperties(){ diff --git a/Core/Bridge/UpdateBridge.cs b/Browser/Bridge/UpdateBridge.cs similarity index 96% rename from Core/Bridge/UpdateBridge.cs rename to Browser/Bridge/UpdateBridge.cs index ada1fdfb..be38e624 100644 --- a/Core/Bridge/UpdateBridge.cs +++ b/Browser/Bridge/UpdateBridge.cs @@ -1,10 +1,10 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Windows.Forms; -using TweetDuck.Core.Controls; +using TweetDuck.Controls; using TweetLib.Core.Features.Updates; -namespace TweetDuck.Core.Bridge{ +namespace TweetDuck.Browser.Bridge{ [SuppressMessage("ReSharper", "UnusedMember.Global")] class UpdateBridge{ private readonly UpdateHandler updates; diff --git a/Core/Management/ContextInfo.cs b/Browser/Data/ContextInfo.cs similarity index 99% rename from Core/Management/ContextInfo.cs rename to Browser/Data/ContextInfo.cs index f9bd7834..ca8cdae9 100644 --- a/Core/Management/ContextInfo.cs +++ b/Browser/Data/ContextInfo.cs @@ -2,7 +2,7 @@ using CefSharp; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Management{ +namespace TweetDuck.Browser.Data{ sealed class ContextInfo{ private LinkInfo link; private ChirpInfo? chirp; diff --git a/Data/ResourceLink.cs b/Browser/Data/ResourceLink.cs similarity index 89% rename from Data/ResourceLink.cs rename to Browser/Data/ResourceLink.cs index bc34d1ad..b133bbd6 100644 --- a/Data/ResourceLink.cs +++ b/Browser/Data/ResourceLink.cs @@ -1,6 +1,6 @@ using CefSharp; -namespace TweetDuck.Data{ +namespace TweetDuck.Browser.Data{ sealed class ResourceLink{ public string Url { get; } public IResourceHandler Handler { get; } diff --git a/Data/WindowState.cs b/Browser/Data/WindowState.cs similarity index 96% rename from Data/WindowState.cs rename to Browser/Data/WindowState.cs index 879858a6..a05e5ae8 100644 --- a/Data/WindowState.cs +++ b/Browser/Data/WindowState.cs @@ -1,10 +1,10 @@ using System.Drawing; using System.Windows.Forms; -using TweetDuck.Core.Controls; +using TweetDuck.Controls; using TweetLib.Core.Serialization.Converters; using TweetLib.Core.Utils; -namespace TweetDuck.Data{ +namespace TweetDuck.Browser.Data{ sealed class WindowState{ private Rectangle rect; private bool isMaximized; diff --git a/Core/FormBrowser.Designer.cs b/Browser/FormBrowser.Designer.cs similarity index 86% rename from Core/FormBrowser.Designer.cs rename to Browser/FormBrowser.Designer.cs index fbb91f0b..95cc98c9 100644 --- a/Core/FormBrowser.Designer.cs +++ b/Browser/FormBrowser.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core { +namespace TweetDuck.Browser { sealed partial class FormBrowser { /// <summary> /// Required designer variable. @@ -13,7 +13,7 @@ sealed partial class FormBrowser { /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.trayIcon = new TweetDuck.Core.Other.TrayIcon(this.components); + this.trayIcon = new TrayIcon(this.components); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.timerResize = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); @@ -27,10 +27,10 @@ private void InitializeComponent() { // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = TweetDuck.Core.Utils.TwitterUtils.BackgroundColor; + this.BackColor = TweetDuck.Utils.TwitterUtils.BackgroundColor; this.ClientSize = new System.Drawing.Size(1008, 730); this.Icon = Properties.Resources.icon; - this.Location = TweetDuck.Core.Controls.ControlExtensions.InvisibleLocation; + this.Location = TweetDuck.Controls.ControlExtensions.InvisibleLocation; this.MinimumSize = new System.Drawing.Size(348, 424); this.Name = "FormBrowser"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; @@ -46,7 +46,7 @@ private void InitializeComponent() { #endregion - private TweetDuck.Core.Other.TrayIcon trayIcon; + private TrayIcon trayIcon; private System.Windows.Forms.ToolTip toolTip; private System.Windows.Forms.Timer timerResize; } diff --git a/Core/FormBrowser.cs b/Browser/FormBrowser.cs similarity index 98% rename from Core/FormBrowser.cs rename to Browser/FormBrowser.cs index 3aa45afa..99ab682e 100644 --- a/Core/FormBrowser.cs +++ b/Browser/FormBrowser.cs @@ -5,24 +5,24 @@ using System.Threading.Tasks; using System.Windows.Forms; using CefSharp; +using TweetDuck.Browser.Bridge; +using TweetDuck.Browser.Handling; +using TweetDuck.Browser.Handling.General; +using TweetDuck.Browser.Notification; +using TweetDuck.Browser.Notification.Screenshot; using TweetDuck.Configuration; -using TweetDuck.Core.Bridge; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Management; -using TweetDuck.Core.Notification; -using TweetDuck.Core.Notification.Screenshot; -using TweetDuck.Core.Other; -using TweetDuck.Core.Other.Analytics; -using TweetDuck.Core.Other.Settings.Dialogs; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Dialogs.Settings; +using TweetDuck.Management; +using TweetDuck.Management.Analytics; using TweetDuck.Updates; +using TweetDuck.Utils; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Events; using TweetLib.Core.Features.Updates; -namespace TweetDuck.Core{ +namespace TweetDuck.Browser{ sealed partial class FormBrowser : Form, AnalyticsFile.IProvider{ private static UserConfig Config => Program.Config.User; diff --git a/Core/FormBrowser.resx b/Browser/FormBrowser.resx similarity index 100% rename from Core/FormBrowser.resx rename to Browser/FormBrowser.resx diff --git a/Core/Handling/ContextMenuBase.cs b/Browser/Handling/ContextMenuBase.cs similarity index 97% rename from Core/Handling/ContextMenuBase.cs rename to Browser/Handling/ContextMenuBase.cs index 2270db1c..21b8431f 100644 --- a/Core/Handling/ContextMenuBase.cs +++ b/Browser/Handling/ContextMenuBase.cs @@ -1,20 +1,20 @@ using System; +using System.Linq; using System.Text.RegularExpressions; using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; -using System.Linq; +using TweetDuck.Browser.Adapters; +using TweetDuck.Browser.Data; +using TweetDuck.Browser.Notification; using TweetDuck.Configuration; -using TweetDuck.Core.Adapters; -using TweetDuck.Core.Management; -using TweetDuck.Core.Notification; -using TweetDuck.Core.Other; -using TweetDuck.Core.Other.Analytics; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Management.Analytics; +using TweetDuck.Utils; using TweetLib.Core.Features.Twitter; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ abstract class ContextMenuBase : IContextMenuHandler{ public static ContextInfo CurrentInfo { get; } = new ContextInfo(); diff --git a/Core/Handling/ContextMenuBrowser.cs b/Browser/Handling/ContextMenuBrowser.cs similarity index 98% rename from Core/Handling/ContextMenuBrowser.cs rename to Browser/Handling/ContextMenuBrowser.cs index 5d016005..e48971d4 100644 --- a/Core/Handling/ContextMenuBrowser.cs +++ b/Browser/Handling/ContextMenuBrowser.cs @@ -1,10 +1,10 @@ -using CefSharp; -using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Management; +using System.Windows.Forms; +using CefSharp; +using TweetDuck.Browser.Data; +using TweetDuck.Controls; using TweetLib.Core.Features.Twitter; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class ContextMenuBrowser : ContextMenuBase{ private const CefMenuCommand MenuGlobal = (CefMenuCommand)26600; private const CefMenuCommand MenuMute = (CefMenuCommand)26601; diff --git a/Core/Handling/ContextMenuGuide.cs b/Browser/Handling/ContextMenuGuide.cs similarity index 86% rename from Core/Handling/ContextMenuGuide.cs rename to Browser/Handling/ContextMenuGuide.cs index e5eb362a..7aa984e3 100644 --- a/Core/Handling/ContextMenuGuide.cs +++ b/Browser/Handling/ContextMenuGuide.cs @@ -1,7 +1,7 @@ using CefSharp; -using TweetDuck.Core.Other.Analytics; +using TweetDuck.Management.Analytics; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class ContextMenuGuide : ContextMenuBase{ public ContextMenuGuide(AnalyticsFile.IProvider analytics) : base(analytics){} diff --git a/Core/Handling/ContextMenuNotification.cs b/Browser/Handling/ContextMenuNotification.cs similarity index 97% rename from Core/Handling/ContextMenuNotification.cs rename to Browser/Handling/ContextMenuNotification.cs index b0974b8e..cfc172e2 100644 --- a/Core/Handling/ContextMenuNotification.cs +++ b/Browser/Handling/ContextMenuNotification.cs @@ -1,8 +1,8 @@ using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Notification; +using TweetDuck.Browser.Notification; +using TweetDuck.Controls; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class ContextMenuNotification : ContextMenuBase{ private const CefMenuCommand MenuViewDetail = (CefMenuCommand)26600; private const CefMenuCommand MenuSkipTweet = (CefMenuCommand)26601; diff --git a/Core/Handling/DragHandlerBrowser.cs b/Browser/Handling/DragHandlerBrowser.cs similarity index 96% rename from Core/Handling/DragHandlerBrowser.cs rename to Browser/Handling/DragHandlerBrowser.cs index ba982df6..c414af5a 100644 --- a/Core/Handling/DragHandlerBrowser.cs +++ b/Browser/Handling/DragHandlerBrowser.cs @@ -2,7 +2,7 @@ using CefSharp; using CefSharp.Enums; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class DragHandlerBrowser : IDragHandler{ private readonly RequestHandlerBrowser requestHandler; diff --git a/Core/Handling/Filters/ResponseFilterBase.cs b/Browser/Handling/Filters/ResponseFilterBase.cs similarity index 98% rename from Core/Handling/Filters/ResponseFilterBase.cs rename to Browser/Handling/Filters/ResponseFilterBase.cs index 1a04ee23..1b52f44d 100644 --- a/Core/Handling/Filters/ResponseFilterBase.cs +++ b/Browser/Handling/Filters/ResponseFilterBase.cs @@ -3,7 +3,7 @@ using System.Text; using CefSharp; -namespace TweetDuck.Core.Handling.Filters{ +namespace TweetDuck.Browser.Handling.Filters{ abstract class ResponseFilterBase : IResponseFilter{ private enum State{ Reading, Writing, Done diff --git a/Core/Handling/Filters/ResponseFilterVendor.cs b/Browser/Handling/Filters/ResponseFilterVendor.cs similarity index 93% rename from Core/Handling/Filters/ResponseFilterVendor.cs rename to Browser/Handling/Filters/ResponseFilterVendor.cs index 13f2bfbf..629faf56 100644 --- a/Core/Handling/Filters/ResponseFilterVendor.cs +++ b/Browser/Handling/Filters/ResponseFilterVendor.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace TweetDuck.Core.Handling.Filters{ +namespace TweetDuck.Browser.Handling.Filters{ sealed class ResponseFilterVendor : ResponseFilterBase{ private static readonly Regex RegexRestoreJQuery = new Regex(@"(\w+)\.fn=\1\.prototype", RegexOptions.Compiled); diff --git a/Core/Handling/General/BrowserProcessHandler.cs b/Browser/Handling/General/BrowserProcessHandler.cs similarity index 95% rename from Core/Handling/General/BrowserProcessHandler.cs rename to Browser/Handling/General/BrowserProcessHandler.cs index 4a010fe9..dc8b07c2 100644 --- a/Core/Handling/General/BrowserProcessHandler.cs +++ b/Browser/Handling/General/BrowserProcessHandler.cs @@ -3,7 +3,7 @@ using CefSharp; using TweetDuck.Configuration; -namespace TweetDuck.Core.Handling.General{ +namespace TweetDuck.Browser.Handling.General{ sealed class BrowserProcessHandler : IBrowserProcessHandler{ public static Task UpdatePrefs(){ return Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal); diff --git a/Core/Handling/General/FileDialogHandler.cs b/Browser/Handling/General/FileDialogHandler.cs similarity index 98% rename from Core/Handling/General/FileDialogHandler.cs rename to Browser/Handling/General/FileDialogHandler.cs index fa2199f7..4d54591f 100644 --- a/Core/Handling/General/FileDialogHandler.cs +++ b/Browser/Handling/General/FileDialogHandler.cs @@ -4,7 +4,7 @@ using System.Windows.Forms; using CefSharp; -namespace TweetDuck.Core.Handling.General{ +namespace TweetDuck.Browser.Handling.General{ sealed class FileDialogHandler : IDialogHandler{ public bool OnFileDialog(IWebBrowser browserControl, IBrowser browser, CefFileDialogMode mode, CefFileDialogFlags flags, string title, string defaultFilePath, List<string> acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback){ if (mode == CefFileDialogMode.Open || mode == CefFileDialogMode.OpenMultiple){ diff --git a/Core/Handling/General/JavaScriptDialogHandler.cs b/Browser/Handling/General/JavaScriptDialogHandler.cs similarity index 96% rename from Core/Handling/General/JavaScriptDialogHandler.cs rename to Browser/Handling/General/JavaScriptDialogHandler.cs index b67e1fcd..0b60524a 100644 --- a/Core/Handling/General/JavaScriptDialogHandler.cs +++ b/Browser/Handling/General/JavaScriptDialogHandler.cs @@ -1,11 +1,11 @@ using System.Drawing; using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Utils; -namespace TweetDuck.Core.Handling.General{ +namespace TweetDuck.Browser.Handling.General{ sealed class JavaScriptDialogHandler : IJsDialogHandler{ private static FormMessage CreateMessageForm(string caption, string text){ MessageBoxIcon icon = MessageBoxIcon.None; diff --git a/Core/Handling/General/LifeSpanHandler.cs b/Browser/Handling/General/LifeSpanHandler.cs similarity index 94% rename from Core/Handling/General/LifeSpanHandler.cs rename to Browser/Handling/General/LifeSpanHandler.cs index 22a5ac39..81d91322 100644 --- a/Core/Handling/General/LifeSpanHandler.cs +++ b/Browser/Handling/General/LifeSpanHandler.cs @@ -1,8 +1,8 @@ using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Utils; -namespace TweetDuck.Core.Handling.General{ +namespace TweetDuck.Browser.Handling.General{ sealed class LifeSpanHandler : ILifeSpanHandler{ private static bool IsPopupAllowed(string url){ return url.StartsWith("https://twitter.com/teams/authorize?"); diff --git a/Core/Handling/KeyboardHandlerBase.cs b/Browser/Handling/KeyboardHandlerBase.cs similarity index 94% rename from Core/Handling/KeyboardHandlerBase.cs rename to Browser/Handling/KeyboardHandlerBase.cs index 30efd4db..57ba2b2a 100644 --- a/Core/Handling/KeyboardHandlerBase.cs +++ b/Browser/Handling/KeyboardHandlerBase.cs @@ -1,10 +1,10 @@ using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Utils; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ class KeyboardHandlerBase : IKeyboardHandler{ protected virtual bool HandleRawKey(IWebBrowser browserControl, IBrowser browser, Keys key, CefEventFlags modifiers){ if (modifiers == (CefEventFlags.ControlDown | CefEventFlags.ShiftDown) && key == Keys.I){ diff --git a/Core/Handling/KeyboardHandlerBrowser.cs b/Browser/Handling/KeyboardHandlerBrowser.cs similarity index 93% rename from Core/Handling/KeyboardHandlerBrowser.cs rename to Browser/Handling/KeyboardHandlerBrowser.cs index 65f84472..eb29ab5b 100644 --- a/Core/Handling/KeyboardHandlerBrowser.cs +++ b/Browser/Handling/KeyboardHandlerBrowser.cs @@ -1,7 +1,7 @@ using System.Windows.Forms; using CefSharp; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class KeyboardHandlerBrowser : KeyboardHandlerBase{ private readonly FormBrowser form; diff --git a/Core/Handling/KeyboardHandlerNotification.cs b/Browser/Handling/KeyboardHandlerNotification.cs similarity index 90% rename from Core/Handling/KeyboardHandlerNotification.cs rename to Browser/Handling/KeyboardHandlerNotification.cs index 06c08fbf..fea83d72 100644 --- a/Core/Handling/KeyboardHandlerNotification.cs +++ b/Browser/Handling/KeyboardHandlerNotification.cs @@ -1,9 +1,9 @@ -using CefSharp; -using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Notification; +using System.Windows.Forms; +using CefSharp; +using TweetDuck.Browser.Notification; +using TweetDuck.Controls; -namespace TweetDuck.Core.Handling { +namespace TweetDuck.Browser.Handling{ sealed class KeyboardHandlerNotification : KeyboardHandlerBase{ private readonly FormNotificationBase notification; diff --git a/Core/Handling/RequestHandlerBase.cs b/Browser/Handling/RequestHandlerBase.cs similarity index 97% rename from Core/Handling/RequestHandlerBase.cs rename to Browser/Handling/RequestHandlerBase.cs index 32864c6f..049c1218 100644 --- a/Core/Handling/RequestHandlerBase.cs +++ b/Browser/Handling/RequestHandlerBase.cs @@ -5,11 +5,11 @@ using System.Text.RegularExpressions; using CefSharp; using CefSharp.Handler; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Utils; +using TweetDuck.Browser.Handling.General; +using TweetDuck.Utils; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ class RequestHandlerBase : DefaultRequestHandler{ private static readonly Regex TweetDeckResourceUrl = new Regex(@"/dist/(.*?)\.(.*?)\.(css|js)$"); private static readonly SortedList<string, string> TweetDeckHashes = new SortedList<string, string>(4); diff --git a/Core/Handling/RequestHandlerBrowser.cs b/Browser/Handling/RequestHandlerBrowser.cs similarity index 96% rename from Core/Handling/RequestHandlerBrowser.cs rename to Browser/Handling/RequestHandlerBrowser.cs index 93456bab..d3d9b328 100644 --- a/Core/Handling/RequestHandlerBrowser.cs +++ b/Browser/Handling/RequestHandlerBrowser.cs @@ -1,10 +1,10 @@ using System.Collections.Specialized; using CefSharp; -using TweetDuck.Core.Handling.Filters; -using TweetDuck.Core.Utils; +using TweetDuck.Browser.Handling.Filters; +using TweetDuck.Utils; using TweetLib.Core.Features.Twitter; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class RequestHandlerBrowser : RequestHandlerBase{ private const string UrlVendorResource = "/dist/vendor"; private const string UrlLoadingSpinner = "/backgrounds/spinner_blue"; diff --git a/Core/Handling/ResourceHandlerFactory.cs b/Browser/Handling/ResourceHandlerFactory.cs similarity index 95% rename from Core/Handling/ResourceHandlerFactory.cs rename to Browser/Handling/ResourceHandlerFactory.cs index cba2649e..0024e464 100644 --- a/Core/Handling/ResourceHandlerFactory.cs +++ b/Browser/Handling/ResourceHandlerFactory.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Concurrent; using CefSharp; -using TweetDuck.Data; +using TweetDuck.Browser.Data; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class ResourceHandlerFactory : IResourceHandlerFactory{ public bool HasHandlers => !handlers.IsEmpty; diff --git a/Core/Handling/ResourceHandlerNotification.cs b/Browser/Handling/ResourceHandlerNotification.cs similarity index 94% rename from Core/Handling/ResourceHandlerNotification.cs rename to Browser/Handling/ResourceHandlerNotification.cs index 53114301..2bc56933 100644 --- a/Core/Handling/ResourceHandlerNotification.cs +++ b/Browser/Handling/ResourceHandlerNotification.cs @@ -1,9 +1,9 @@ -using CefSharp; -using System.Collections.Specialized; +using System.Collections.Specialized; using System.IO; using System.Text; +using CefSharp; -namespace TweetDuck.Core.Handling{ +namespace TweetDuck.Browser.Handling{ sealed class ResourceHandlerNotification : IResourceHandler{ private readonly NameValueCollection headers = new NameValueCollection(0); private MemoryStream dataIn; diff --git a/Core/Notification/Example/FormNotificationExample.cs b/Browser/Notification/Example/FormNotificationExample.cs similarity index 96% rename from Core/Notification/Example/FormNotificationExample.cs rename to Browser/Notification/Example/FormNotificationExample.cs index 6d3dc914..759eb243 100644 --- a/Core/Notification/Example/FormNotificationExample.cs +++ b/Browser/Notification/Example/FormNotificationExample.cs @@ -1,11 +1,11 @@ using System; using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Controls; +using TweetDuck.Controls; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Plugins; -namespace TweetDuck.Core.Notification.Example{ +namespace TweetDuck.Browser.Notification.Example{ sealed class FormNotificationExample : FormNotificationMain{ public override bool RequiresResize => true; protected override bool CanDragWindow => Config.NotificationPosition == DesktopNotification.Position.Custom; diff --git a/Core/Notification/FormNotificationBase.Designer.cs b/Browser/Notification/FormNotificationBase.Designer.cs similarity index 91% rename from Core/Notification/FormNotificationBase.Designer.cs rename to Browser/Notification/FormNotificationBase.Designer.cs index 160f8c88..066327c5 100644 --- a/Core/Notification/FormNotificationBase.Designer.cs +++ b/Browser/Notification/FormNotificationBase.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Notification { +namespace TweetDuck.Browser.Notification { partial class FormNotificationBase { /// <summary> /// Required designer variable. @@ -23,7 +23,7 @@ private void InitializeComponent() { this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(284, 122); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Location = TweetDuck.Core.Controls.ControlExtensions.InvisibleLocation; + this.Location = TweetDuck.Controls.ControlExtensions.InvisibleLocation; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FormNotification"; diff --git a/Core/Notification/FormNotificationBase.cs b/Browser/Notification/FormNotificationBase.cs similarity index 96% rename from Core/Notification/FormNotificationBase.cs rename to Browser/Notification/FormNotificationBase.cs index e8812ea1..5ef75528 100644 --- a/Core/Notification/FormNotificationBase.cs +++ b/Browser/Notification/FormNotificationBase.cs @@ -1,18 +1,18 @@ -using CefSharp.WinForms; -using System.Drawing; +using System.Drawing; using System.Windows.Forms; using CefSharp; +using CefSharp.WinForms; +using TweetDuck.Browser.Data; +using TweetDuck.Browser.Handling; +using TweetDuck.Browser.Handling.General; using TweetDuck.Configuration; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Other.Analytics; -using TweetDuck.Core.Utils; -using TweetDuck.Data; +using TweetDuck.Controls; +using TweetDuck.Management.Analytics; +using TweetDuck.Utils; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Twitter; -namespace TweetDuck.Core.Notification{ +namespace TweetDuck.Browser.Notification{ abstract partial class FormNotificationBase : Form, AnalyticsFile.IProvider{ public static readonly ResourceLink AppLogo = new ResourceLink("https://ton.twimg.com/tduck/avatar", ResourceHandler.FromByteArray(Properties.Resources.avatar, "image/png")); diff --git a/Core/Notification/FormNotificationMain.Designer.cs b/Browser/Notification/FormNotificationMain.Designer.cs similarity index 96% rename from Core/Notification/FormNotificationMain.Designer.cs rename to Browser/Notification/FormNotificationMain.Designer.cs index 5e101b44..c024d08e 100644 --- a/Core/Notification/FormNotificationMain.Designer.cs +++ b/Browser/Notification/FormNotificationMain.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Notification { +namespace TweetDuck.Browser.Notification { partial class FormNotificationMain { /// <summary> /// Required designer variable. @@ -26,7 +26,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.timerDisplayDelay = new System.Windows.Forms.Timer(this.components); this.timerProgress = new System.Windows.Forms.Timer(this.components); - this.progressBarTimer = new TweetDuck.Core.Controls.FlatProgressBar(); + this.progressBarTimer = new TweetDuck.Controls.FlatProgressBar(); this.SuspendLayout(); // // timerDisplayDelay diff --git a/Core/Notification/FormNotificationMain.cs b/Browser/Notification/FormNotificationMain.cs similarity index 97% rename from Core/Notification/FormNotificationMain.cs rename to Browser/Notification/FormNotificationMain.cs index f23d86da..c92c7adf 100644 --- a/Core/Notification/FormNotificationMain.cs +++ b/Browser/Notification/FormNotificationMain.cs @@ -1,19 +1,19 @@ -using CefSharp; -using System; +using System; using System.Drawing; using System.Windows.Forms; -using TweetDuck.Core.Adapters; -using TweetDuck.Core.Bridge; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Utils; +using CefSharp; +using TweetDuck.Browser.Adapters; +using TweetDuck.Browser.Bridge; +using TweetDuck.Browser.Handling; +using TweetDuck.Controls; using TweetDuck.Plugins; +using TweetDuck.Utils; using TweetLib.Core.Data; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Enums; -namespace TweetDuck.Core.Notification{ +namespace TweetDuck.Browser.Notification{ abstract partial class FormNotificationMain : FormNotificationBase{ private readonly PluginManager plugins; private readonly int timerBarHeight; diff --git a/Core/Notification/FormNotificationTweet.Designer.cs b/Browser/Notification/FormNotificationTweet.Designer.cs similarity index 97% rename from Core/Notification/FormNotificationTweet.Designer.cs rename to Browser/Notification/FormNotificationTweet.Designer.cs index 6c6c07b9..a45e38de 100644 --- a/Core/Notification/FormNotificationTweet.Designer.cs +++ b/Browser/Notification/FormNotificationTweet.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Notification { +namespace TweetDuck.Browser.Notification { partial class FormNotificationTweet { /// <summary> /// Required designer variable. diff --git a/Core/Notification/FormNotificationTweet.cs b/Browser/Notification/FormNotificationTweet.cs similarity index 98% rename from Core/Notification/FormNotificationTweet.cs rename to Browser/Notification/FormNotificationTweet.cs index 39d69607..babe8bda 100644 --- a/Core/Notification/FormNotificationTweet.cs +++ b/Browser/Notification/FormNotificationTweet.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; -using TweetDuck.Core.Utils; +using TweetDuck.Utils; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Plugins; -namespace TweetDuck.Core.Notification{ +namespace TweetDuck.Browser.Notification{ sealed partial class FormNotificationTweet : FormNotificationMain{ private const int NonIntrusiveIdleLimit = 30; private const int TrimMinimum = 32; diff --git a/Core/Notification/Screenshot/FormNotificationScreenshotable.cs b/Browser/Notification/Screenshot/FormNotificationScreenshotable.cs similarity index 95% rename from Core/Notification/Screenshot/FormNotificationScreenshotable.cs rename to Browser/Notification/Screenshot/FormNotificationScreenshotable.cs index 84a932cb..a0628fbb 100644 --- a/Core/Notification/Screenshot/FormNotificationScreenshotable.cs +++ b/Browser/Notification/Screenshot/FormNotificationScreenshotable.cs @@ -3,15 +3,15 @@ using System.Drawing.Imaging; using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Adapters; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; -using TweetDuck.Core.Utils; +using TweetDuck.Browser.Adapters; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Utils; using TweetLib.Core.Data; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Plugins; -namespace TweetDuck.Core.Notification.Screenshot{ +namespace TweetDuck.Browser.Notification.Screenshot{ sealed class FormNotificationScreenshotable : FormNotificationBase{ protected override bool CanDragWindow => false; diff --git a/Core/Notification/Screenshot/ScreenshotBridge.cs b/Browser/Notification/Screenshot/ScreenshotBridge.cs similarity index 91% rename from Core/Notification/Screenshot/ScreenshotBridge.cs rename to Browser/Notification/Screenshot/ScreenshotBridge.cs index 873f6dc9..e44cc9eb 100644 --- a/Core/Notification/Screenshot/ScreenshotBridge.cs +++ b/Browser/Notification/Screenshot/ScreenshotBridge.cs @@ -1,9 +1,9 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Windows.Forms; -using TweetDuck.Core.Controls; +using TweetDuck.Controls; -namespace TweetDuck.Core.Notification.Screenshot{ +namespace TweetDuck.Browser.Notification.Screenshot{ [SuppressMessage("ReSharper", "UnusedMember.Global")] sealed class ScreenshotBridge{ private readonly Control owner; diff --git a/Core/Notification/Screenshot/TweetScreenshotManager.cs b/Browser/Notification/Screenshot/TweetScreenshotManager.cs similarity index 98% rename from Core/Notification/Screenshot/TweetScreenshotManager.cs rename to Browser/Notification/Screenshot/TweetScreenshotManager.cs index 26c7f5bc..8f58dd09 100644 --- a/Core/Notification/Screenshot/TweetScreenshotManager.cs +++ b/Browser/Notification/Screenshot/TweetScreenshotManager.cs @@ -8,7 +8,7 @@ using System; using System.Windows.Forms; -using TweetDuck.Core.Controls; +using TweetDuck.Controls; using TweetLib.Core.Features.Plugins; #if GEN_SCREENSHOT_FRAMES @@ -17,7 +17,7 @@ using TweetDuck.Core.Utils; #endif -namespace TweetDuck.Core.Notification.Screenshot{ +namespace TweetDuck.Browser.Notification.Screenshot{ sealed class TweetScreenshotManager : IDisposable{ private readonly FormBrowser owner; private readonly PluginManager plugins; diff --git a/Core/Notification/SoundNotification.cs b/Browser/Notification/SoundNotification.cs similarity index 91% rename from Core/Notification/SoundNotification.cs rename to Browser/Notification/SoundNotification.cs index 30a8c632..93f9e92d 100644 --- a/Core/Notification/SoundNotification.cs +++ b/Browser/Notification/SoundNotification.cs @@ -2,11 +2,12 @@ using System.IO; using System.Windows.Forms; using CefSharp; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; -using TweetDuck.Core.Other.Settings; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Dialogs.Settings; +using TweetDuck.Management; -namespace TweetDuck.Core.Notification{ +namespace TweetDuck.Browser.Notification{ static class SoundNotification{ public const string SupportedFormats = "*.wav;*.ogg;*.mp3;*.flac;*.opus;*.weba;*.webm"; diff --git a/Core/Other/TrayIcon.Designer.cs b/Browser/TrayIcon.Designer.cs similarity index 96% rename from Core/Other/TrayIcon.Designer.cs rename to Browser/TrayIcon.Designer.cs index 1e0add57..14f27ee3 100644 --- a/Core/Other/TrayIcon.Designer.cs +++ b/Browser/TrayIcon.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other { +namespace TweetDuck.Browser { partial class TrayIcon { /// <summary> /// Required designer variable. diff --git a/Core/Other/TrayIcon.cs b/Browser/TrayIcon.cs similarity index 99% rename from Core/Other/TrayIcon.cs rename to Browser/TrayIcon.cs index 2b406b75..5b0a2c98 100644 --- a/Core/Other/TrayIcon.cs +++ b/Browser/TrayIcon.cs @@ -4,7 +4,7 @@ using TweetDuck.Configuration; using Res = TweetDuck.Properties.Resources; -namespace TweetDuck.Core.Other{ +namespace TweetDuck.Browser{ sealed partial class TrayIcon : Component{ public enum Behavior{ // keep order Disabled, DisplayOnly, MinimizeToTray, CloseToTray, Combined diff --git a/Core/TweetDeckBrowser.cs b/Browser/TweetDeckBrowser.cs similarity index 97% rename from Core/TweetDeckBrowser.cs rename to Browser/TweetDeckBrowser.cs index 184cfc7a..62a14a0a 100644 --- a/Core/TweetDeckBrowser.cs +++ b/Browser/TweetDeckBrowser.cs @@ -4,21 +4,21 @@ using System.Windows.Forms; using CefSharp; using CefSharp.WinForms; +using TweetDuck.Browser.Adapters; +using TweetDuck.Browser.Bridge; +using TweetDuck.Browser.Handling; +using TweetDuck.Browser.Handling.General; +using TweetDuck.Browser.Notification; using TweetDuck.Configuration; -using TweetDuck.Core.Adapters; -using TweetDuck.Core.Bridge; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Notification; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; using TweetDuck.Plugins; +using TweetDuck.Utils; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Features.Twitter; using TweetLib.Core.Utils; -namespace TweetDuck.Core{ +namespace TweetDuck.Browser{ sealed class TweetDeckBrowser : IDisposable{ private static UserConfig Config => Program.Config.User; diff --git a/Configuration/ConfigManager.cs b/Configuration/ConfigManager.cs index 547f3413..3d2c6c40 100644 --- a/Configuration/ConfigManager.cs +++ b/Configuration/ConfigManager.cs @@ -1,6 +1,6 @@ using System; using System.Drawing; -using TweetDuck.Data; +using TweetDuck.Browser.Data; using TweetLib.Core.Features.Configuration; using TweetLib.Core.Features.Plugins.Config; using TweetLib.Core.Serialization.Converters; diff --git a/Configuration/UserConfig.cs b/Configuration/UserConfig.cs index 1ce0a2b7..699dcf3d 100644 --- a/Configuration/UserConfig.cs +++ b/Configuration/UserConfig.cs @@ -1,8 +1,8 @@ using System; using System.Drawing; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; -using TweetDuck.Data; +using TweetDuck.Browser; +using TweetDuck.Browser.Data; +using TweetDuck.Controls; using TweetLib.Core.Features.Configuration; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Twitter; diff --git a/Core/Controls/ControlExtensions.cs b/Controls/ControlExtensions.cs similarity index 98% rename from Core/Controls/ControlExtensions.cs rename to Controls/ControlExtensions.cs index 9c8da569..24a71e7c 100644 --- a/Core/Controls/ControlExtensions.cs +++ b/Controls/ControlExtensions.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Windows.Forms; -namespace TweetDuck.Core.Controls{ +namespace TweetDuck.Controls{ static class ControlExtensions{ public static readonly Point InvisibleLocation = new Point(-32000, -32000); diff --git a/Core/Controls/FlatButton.cs b/Controls/FlatButton.cs similarity index 91% rename from Core/Controls/FlatButton.cs rename to Controls/FlatButton.cs index 45dedbde..f670a574 100644 --- a/Core/Controls/FlatButton.cs +++ b/Controls/FlatButton.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace TweetDuck.Core.Controls{ +namespace TweetDuck.Controls{ sealed class FlatButton : Button{ protected override bool ShowFocusCues => false; diff --git a/Core/Controls/FlatProgressBar.cs b/Controls/FlatProgressBar.cs similarity index 96% rename from Core/Controls/FlatProgressBar.cs rename to Controls/FlatProgressBar.cs index d56b2f77..83b30695 100644 --- a/Core/Controls/FlatProgressBar.cs +++ b/Controls/FlatProgressBar.cs @@ -2,7 +2,7 @@ using System.Drawing; using System.Windows.Forms; -namespace TweetDuck.Core.Controls{ +namespace TweetDuck.Controls{ sealed class FlatProgressBar : ProgressBar{ private readonly SolidBrush brush; diff --git a/Core/Controls/FlowLayoutPanelNoHScroll.cs b/Controls/FlowLayoutPanelNoHScroll.cs similarity index 86% rename from Core/Controls/FlowLayoutPanelNoHScroll.cs rename to Controls/FlowLayoutPanelNoHScroll.cs index d97c0541..021e4f3d 100644 --- a/Core/Controls/FlowLayoutPanelNoHScroll.cs +++ b/Controls/FlowLayoutPanelNoHScroll.cs @@ -1,7 +1,7 @@ using System.Windows.Forms; -using TweetDuck.Core.Utils; +using TweetDuck.Utils; -namespace TweetDuck.Core.Controls{ +namespace TweetDuck.Controls{ sealed class FlowLayoutPanelNoHScroll : FlowLayoutPanel{ protected override void WndProc(ref Message m){ if (m.Msg == 0x85){ // WM_NCPAINT diff --git a/Core/Controls/LabelVertical.cs b/Controls/LabelVertical.cs similarity index 95% rename from Core/Controls/LabelVertical.cs rename to Controls/LabelVertical.cs index ca6117f2..8625f6b9 100644 --- a/Core/Controls/LabelVertical.cs +++ b/Controls/LabelVertical.cs @@ -2,7 +2,7 @@ using System.Drawing; using System.Windows.Forms; -namespace TweetDuck.Core.Controls{ +namespace TweetDuck.Controls{ sealed class LabelVertical : Label{ public int LineHeight { get; set; } diff --git a/Core/Controls/NumericUpDownEx.cs b/Controls/NumericUpDownEx.cs similarity index 92% rename from Core/Controls/NumericUpDownEx.cs rename to Controls/NumericUpDownEx.cs index 28209379..15a0cdd3 100644 --- a/Core/Controls/NumericUpDownEx.cs +++ b/Controls/NumericUpDownEx.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.Windows.Forms; -namespace TweetDuck.Core.Controls{ +namespace TweetDuck.Controls{ sealed class NumericUpDownEx : NumericUpDown{ public string TextSuffix { get; set ; } diff --git a/Core/Other/Settings/BaseTabSettings.cs b/Core/Other/Settings/BaseTabSettings.cs deleted file mode 100644 index f469a80b..00000000 --- a/Core/Other/Settings/BaseTabSettings.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using System.Windows.Forms; -using TweetDuck.Configuration; - -namespace TweetDuck.Core.Other.Settings{ - class BaseTabSettings : UserControl{ - protected static UserConfig Config => Program.Config.User; - protected static SystemConfig SysConfig => Program.Config.System; - - public IEnumerable<Control> InteractiveControls{ - get{ - static IEnumerable<Control> FindInteractiveControls(Control parent){ - foreach(Control control in parent.Controls){ - if (control is Panel subPanel){ - foreach(Control subControl in FindInteractiveControls(subPanel)){ - yield return subControl; - } - } - else{ - yield return control; - } - } - } - - return FindInteractiveControls(this); - } - } - - protected BaseTabSettings(){ - Padding = new Padding(6); - } - - public virtual void OnReady(){} - public virtual void OnClosing(){} - } -} diff --git a/Core/Other/FormAbout.Designer.cs b/Dialogs/FormAbout.Designer.cs similarity index 99% rename from Core/Other/FormAbout.Designer.cs rename to Dialogs/FormAbout.Designer.cs index 0231f2e9..63fd256b 100644 --- a/Core/Other/FormAbout.Designer.cs +++ b/Dialogs/FormAbout.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other { +namespace TweetDuck.Dialogs { sealed partial class FormAbout { /// <summary> /// Required designer variable. diff --git a/Core/Other/FormAbout.cs b/Dialogs/FormAbout.cs similarity index 95% rename from Core/Other/FormAbout.cs rename to Dialogs/FormAbout.cs index b660a3b6..872020ea 100644 --- a/Core/Other/FormAbout.cs +++ b/Dialogs/FormAbout.cs @@ -2,9 +2,10 @@ using System.Drawing; using System.IO; using System.Windows.Forms; -using TweetDuck.Core.Utils; +using TweetDuck.Management; +using TweetDuck.Utils; -namespace TweetDuck.Core.Other{ +namespace TweetDuck.Dialogs{ sealed partial class FormAbout : Form, FormManager.IAppDialog{ private const string TipsLink = "https://github.com/chylex/TweetDuck/wiki"; private const string IssuesLink = "https://github.com/chylex/TweetDuck/issues"; diff --git a/Core/Other/FormGuide.Designer.cs b/Dialogs/FormGuide.Designer.cs similarity index 97% rename from Core/Other/FormGuide.Designer.cs rename to Dialogs/FormGuide.Designer.cs index aea6ce1d..8de4de70 100644 --- a/Core/Other/FormGuide.Designer.cs +++ b/Dialogs/FormGuide.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other { +namespace TweetDuck.Dialogs { partial class FormGuide { /// <summary> /// Required designer variable. diff --git a/Core/Other/FormGuide.cs b/Dialogs/FormGuide.cs similarity index 94% rename from Core/Other/FormGuide.cs rename to Dialogs/FormGuide.cs index f2021d88..6f2b5730 100644 --- a/Core/Other/FormGuide.cs +++ b/Dialogs/FormGuide.cs @@ -1,16 +1,18 @@ using System.Drawing; +using System.Text.RegularExpressions; using System.Windows.Forms; using CefSharp; using CefSharp.WinForms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Utils; -using System.Text.RegularExpressions; -using TweetDuck.Core.Adapters; -using TweetDuck.Data; +using TweetDuck.Browser; +using TweetDuck.Browser.Adapters; +using TweetDuck.Browser.Data; +using TweetDuck.Browser.Handling; +using TweetDuck.Browser.Handling.General; +using TweetDuck.Controls; +using TweetDuck.Management; +using TweetDuck.Utils; -namespace TweetDuck.Core.Other{ +namespace TweetDuck.Dialogs{ sealed partial class FormGuide : Form, FormManager.IAppDialog{ private const string GuideUrl = "https://tweetduck.chylex.com/guide/v2/"; private const string GuidePathRegex = @"^guide(?:/v\d+)?(?:/(#.*))?"; diff --git a/Core/Other/FormMessage.Designer.cs b/Dialogs/FormMessage.Designer.cs similarity index 99% rename from Core/Other/FormMessage.Designer.cs rename to Dialogs/FormMessage.Designer.cs index ff238249..679d885a 100644 --- a/Core/Other/FormMessage.Designer.cs +++ b/Dialogs/FormMessage.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other { +namespace TweetDuck.Dialogs { partial class FormMessage { /// <summary> /// Required designer variable. diff --git a/Core/Other/FormMessage.cs b/Dialogs/FormMessage.cs similarity index 98% rename from Core/Other/FormMessage.cs rename to Dialogs/FormMessage.cs index 0691dc75..713ba793 100644 --- a/Core/Other/FormMessage.cs +++ b/Dialogs/FormMessage.cs @@ -1,10 +1,10 @@ using System; using System.Drawing; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Utils; -namespace TweetDuck.Core.Other{ +namespace TweetDuck.Dialogs{ [Flags] enum ControlType{ None = 0, diff --git a/Core/Other/FormPlugins.Designer.cs b/Dialogs/FormPlugins.Designer.cs similarity index 98% rename from Core/Other/FormPlugins.Designer.cs rename to Dialogs/FormPlugins.Designer.cs index 7e3a8156..d5864d91 100644 --- a/Core/Other/FormPlugins.Designer.cs +++ b/Dialogs/FormPlugins.Designer.cs @@ -1,6 +1,6 @@ -using TweetDuck.Core.Controls; +using TweetDuck.Controls; -namespace TweetDuck.Core.Other { +namespace TweetDuck.Dialogs { partial class FormPlugins { /// <summary> /// Required designer variable. diff --git a/Core/Other/FormPlugins.cs b/Dialogs/FormPlugins.cs similarity index 98% rename from Core/Other/FormPlugins.cs rename to Dialogs/FormPlugins.cs index 9d123fa4..54b3d8bc 100644 --- a/Core/Other/FormPlugins.cs +++ b/Dialogs/FormPlugins.cs @@ -3,11 +3,12 @@ using System.Linq; using System.Windows.Forms; using TweetDuck.Configuration; +using TweetDuck.Management; using TweetDuck.Plugins; using TweetLib.Core; using TweetLib.Core.Features.Plugins; -namespace TweetDuck.Core.Other{ +namespace TweetDuck.Dialogs{ sealed partial class FormPlugins : Form, FormManager.IAppDialog{ private static UserConfig Config => Program.Config.User; diff --git a/Core/Other/FormSettings.Designer.cs b/Dialogs/FormSettings.Designer.cs similarity index 99% rename from Core/Other/FormSettings.Designer.cs rename to Dialogs/FormSettings.Designer.cs index d30f6a10..39565948 100644 --- a/Core/Other/FormSettings.Designer.cs +++ b/Dialogs/FormSettings.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other { +namespace TweetDuck.Dialogs { sealed partial class FormSettings { /// <summary> /// Required designer variable. diff --git a/Core/Other/FormSettings.cs b/Dialogs/FormSettings.cs similarity index 80% rename from Core/Other/FormSettings.cs rename to Dialogs/FormSettings.cs index a1e789f5..4f3d45e0 100644 --- a/Core/Other/FormSettings.cs +++ b/Dialogs/FormSettings.cs @@ -2,17 +2,19 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Notification.Example; -using TweetDuck.Core.Other.Analytics; -using TweetDuck.Core.Other.Settings; -using TweetDuck.Core.Other.Settings.Dialogs; -using TweetDuck.Core.Utils; +using TweetDuck.Browser; +using TweetDuck.Browser.Handling.General; +using TweetDuck.Browser.Notification.Example; +using TweetDuck.Configuration; +using TweetDuck.Controls; +using TweetDuck.Dialogs.Settings; +using TweetDuck.Management; +using TweetDuck.Management.Analytics; +using TweetDuck.Utils; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Updates; -namespace TweetDuck.Core.Other{ +namespace TweetDuck.Dialogs{ sealed partial class FormSettings : Form, FormManager.IAppDialog{ public bool ShouldReloadBrowser { get; private set; } @@ -105,7 +107,7 @@ private void btnClose_Click(object sender, EventArgs e){ Close(); } - private void AddButton<T>(string title, Func<T> constructor) where T : BaseTabSettings{ + private void AddButton<T>(string title, Func<T> constructor) where T : BaseTab{ FlatButton btn = new FlatButton{ BackColor = SystemColors.Control, FlatStyle = FlatStyle.Flat, @@ -135,7 +137,7 @@ private void AddButton<T>(string title, Func<T> constructor) where T : BaseTabSe btn.Click += (sender, args) => SelectTab<T>(); } - private void SelectTab<T>() where T : BaseTabSettings{ + private void SelectTab<T>() where T : BaseTab{ SelectTab(tabs[typeof(T)]); } @@ -195,16 +197,47 @@ private void control_MouseWheel(object sender, MouseEventArgs e){ private sealed class SettingsTab{ public Button Button { get; } - public BaseTabSettings Control => control ??= constructor(); + public BaseTab Control => control ??= constructor(); public bool IsInitialized => control != null; - private readonly Func<BaseTabSettings> constructor; - private BaseTabSettings control; + private readonly Func<BaseTab> constructor; + private BaseTab control; - public SettingsTab(Button button, Func<BaseTabSettings> constructor){ + public SettingsTab(Button button, Func<BaseTab> constructor){ this.Button = button; this.constructor = constructor; } } + + internal abstract class BaseTab : UserControl{ + protected static UserConfig Config => Program.Config.User; + protected static SystemConfig SysConfig => Program.Config.System; + + public IEnumerable<Control> InteractiveControls{ + get{ + static IEnumerable<Control> FindInteractiveControls(Control parent){ + foreach(Control control in parent.Controls){ + if (control is Panel subPanel){ + foreach(Control subControl in FindInteractiveControls(subPanel)){ + yield return subControl; + } + } + else{ + yield return control; + } + } + } + + return FindInteractiveControls(this); + } + } + + protected BaseTab(){ + Padding = new Padding(6); + } + + public virtual void OnReady(){} + public virtual void OnClosing(){} + } } } diff --git a/Core/Other/Settings/Dialogs/DialogSettingsAnalytics.Designer.cs b/Dialogs/Settings/DialogSettingsAnalytics.Designer.cs similarity index 98% rename from Core/Other/Settings/Dialogs/DialogSettingsAnalytics.Designer.cs rename to Dialogs/Settings/DialogSettingsAnalytics.Designer.cs index 8d43d820..380cb2ff 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsAnalytics.Designer.cs +++ b/Dialogs/Settings/DialogSettingsAnalytics.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsAnalytics { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsAnalytics.cs b/Dialogs/Settings/DialogSettingsAnalytics.cs similarity index 82% rename from Core/Other/Settings/Dialogs/DialogSettingsAnalytics.cs rename to Dialogs/Settings/DialogSettingsAnalytics.cs index 5d5174e0..f7294990 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsAnalytics.cs +++ b/Dialogs/Settings/DialogSettingsAnalytics.cs @@ -1,9 +1,9 @@ using System; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other.Analytics; +using TweetDuck.Controls; +using TweetDuck.Management.Analytics; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsAnalytics : Form{ public DialogSettingsAnalytics(AnalyticsReport report){ InitializeComponent(); diff --git a/Core/Other/Settings/Dialogs/DialogSettingsCSS.Designer.cs b/Dialogs/Settings/DialogSettingsCSS.Designer.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsCSS.Designer.cs rename to Dialogs/Settings/DialogSettingsCSS.Designer.cs index e23ffadf..7f52892f 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsCSS.Designer.cs +++ b/Dialogs/Settings/DialogSettingsCSS.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsCSS { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsCSS.cs b/Dialogs/Settings/DialogSettingsCSS.cs similarity index 98% rename from Core/Other/Settings/Dialogs/DialogSettingsCSS.cs rename to Dialogs/Settings/DialogSettingsCSS.cs index 5576d4e6..bab38bfe 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsCSS.cs +++ b/Dialogs/Settings/DialogSettingsCSS.cs @@ -2,10 +2,10 @@ using System.Linq; using System.Text.RegularExpressions; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Utils; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsCSS : Form{ public string BrowserCSS => textBoxBrowserCSS.Text; public string NotificationCSS => textBoxNotificationCSS.Text; diff --git a/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.Designer.cs b/Dialogs/Settings/DialogSettingsCefArgs.Designer.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsCefArgs.Designer.cs rename to Dialogs/Settings/DialogSettingsCefArgs.Designer.cs index b61aae32..921a3e95 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.Designer.cs +++ b/Dialogs/Settings/DialogSettingsCefArgs.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsCefArgs { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs b/Dialogs/Settings/DialogSettingsCefArgs.cs similarity index 93% rename from Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs rename to Dialogs/Settings/DialogSettingsCefArgs.cs index b75fe979..cecbd75c 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs +++ b/Dialogs/Settings/DialogSettingsCefArgs.cs @@ -1,10 +1,10 @@ using System; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Utils; using TweetLib.Core.Collections; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsCefArgs : Form{ public string CefArgs => textBoxArgs.Text; diff --git a/Core/Other/Settings/Dialogs/DialogSettingsExternalProgram.Designer.cs b/Dialogs/Settings/DialogSettingsExternalProgram.Designer.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsExternalProgram.Designer.cs rename to Dialogs/Settings/DialogSettingsExternalProgram.Designer.cs index 71a0532f..78b456e7 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsExternalProgram.Designer.cs +++ b/Dialogs/Settings/DialogSettingsExternalProgram.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsExternalProgram { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsExternalProgram.cs b/Dialogs/Settings/DialogSettingsExternalProgram.cs similarity index 97% rename from Core/Other/Settings/Dialogs/DialogSettingsExternalProgram.cs rename to Dialogs/Settings/DialogSettingsExternalProgram.cs index f775d3e6..6672c253 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsExternalProgram.cs +++ b/Dialogs/Settings/DialogSettingsExternalProgram.cs @@ -3,7 +3,7 @@ using TweetLib.Core.Utils; using IOPath = System.IO.Path; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsExternalProgram : Form{ public string Path{ get => StringUtils.NullIfEmpty(textBoxPath.Text); diff --git a/Core/Other/Settings/Dialogs/DialogSettingsManage.Designer.cs b/Dialogs/Settings/DialogSettingsManage.Designer.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsManage.Designer.cs rename to Dialogs/Settings/DialogSettingsManage.Designer.cs index cdde2832..01e812d5 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsManage.Designer.cs +++ b/Dialogs/Settings/DialogSettingsManage.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsManage { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsManage.cs b/Dialogs/Settings/DialogSettingsManage.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsManage.cs rename to Dialogs/Settings/DialogSettingsManage.cs index ea36d0a9..8115f019 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsManage.cs +++ b/Dialogs/Settings/DialogSettingsManage.cs @@ -3,11 +3,11 @@ using System.IO; using System.Windows.Forms; using TweetDuck.Configuration; -using TweetDuck.Core.Management; +using TweetDuck.Management; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsManage : Form{ private enum State{ Deciding, Reset, Import, Export diff --git a/Core/Other/Settings/Dialogs/DialogSettingsRestart.Designer.cs b/Dialogs/Settings/DialogSettingsRestart.Designer.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsRestart.Designer.cs rename to Dialogs/Settings/DialogSettingsRestart.Designer.cs index c7e93f2a..30098438 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsRestart.Designer.cs +++ b/Dialogs/Settings/DialogSettingsRestart.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsRestart { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsRestart.cs b/Dialogs/Settings/DialogSettingsRestart.cs similarity index 92% rename from Core/Other/Settings/Dialogs/DialogSettingsRestart.cs rename to Dialogs/Settings/DialogSettingsRestart.cs index 4e2fa29c..88dbaa30 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsRestart.cs +++ b/Dialogs/Settings/DialogSettingsRestart.cs @@ -3,7 +3,7 @@ using TweetDuck.Configuration; using TweetLib.Core.Collections; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsRestart : Form{ public CommandLineArgs Args { get; private set; } @@ -38,7 +38,7 @@ private void control_Change(object sender, EventArgs e){ Args.SetValue(Arguments.ArgDataFolder, tbDataFolder.Text); } - tbShortcutTarget.Text = $@"""{Application.ExecutablePath}""{(Args.Count > 0 ? " " : "")}{Args}"; + tbShortcutTarget.Text = $@"""{Program.ExecutablePath}""{(Args.Count > 0 ? " " : "")}{Args}"; tbShortcutTarget.Select(tbShortcutTarget.Text.Length, 0); } diff --git a/Core/Other/Settings/Dialogs/DialogSettingsSearchEngine.Designer.cs b/Dialogs/Settings/DialogSettingsSearchEngine.Designer.cs similarity index 99% rename from Core/Other/Settings/Dialogs/DialogSettingsSearchEngine.Designer.cs rename to Dialogs/Settings/DialogSettingsSearchEngine.Designer.cs index 54040e9a..ea14533b 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsSearchEngine.Designer.cs +++ b/Dialogs/Settings/DialogSettingsSearchEngine.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings.Dialogs { +namespace TweetDuck.Dialogs.Settings { partial class DialogSettingsSearchEngine { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/Dialogs/DialogSettingsSearchEngine.cs b/Dialogs/Settings/DialogSettingsSearchEngine.cs similarity index 94% rename from Core/Other/Settings/Dialogs/DialogSettingsSearchEngine.cs rename to Dialogs/Settings/DialogSettingsSearchEngine.cs index f3151c98..012ca542 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsSearchEngine.cs +++ b/Dialogs/Settings/DialogSettingsSearchEngine.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace TweetDuck.Core.Other.Settings.Dialogs{ +namespace TweetDuck.Dialogs.Settings{ sealed partial class DialogSettingsSearchEngine : Form{ public string Url => textBoxUrl.Text; diff --git a/Core/Other/Settings/TabSettingsAdvanced.Designer.cs b/Dialogs/Settings/TabSettingsAdvanced.Designer.cs similarity index 99% rename from Core/Other/Settings/TabSettingsAdvanced.Designer.cs rename to Dialogs/Settings/TabSettingsAdvanced.Designer.cs index 477db513..fcf5977b 100644 --- a/Core/Other/Settings/TabSettingsAdvanced.Designer.cs +++ b/Dialogs/Settings/TabSettingsAdvanced.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings { +namespace TweetDuck.Dialogs.Settings { partial class TabSettingsAdvanced { /// <summary> /// Required designer variable. @@ -32,7 +32,7 @@ private void InitializeComponent() { this.btnRestart = new System.Windows.Forms.Button(); this.btnOpenAppFolder = new System.Windows.Forms.Button(); this.btnOpenDataFolder = new System.Windows.Forms.Button(); - this.numClearCacheThreshold = new TweetDuck.Core.Controls.NumericUpDownEx(); + this.numClearCacheThreshold = new TweetDuck.Controls.NumericUpDownEx(); this.checkClearCacheAuto = new System.Windows.Forms.CheckBox(); this.labelApp = new System.Windows.Forms.Label(); this.panelAppButtons = new System.Windows.Forms.Panel(); diff --git a/Core/Other/Settings/TabSettingsAdvanced.cs b/Dialogs/Settings/TabSettingsAdvanced.cs similarity index 96% rename from Core/Other/Settings/TabSettingsAdvanced.cs rename to Dialogs/Settings/TabSettingsAdvanced.cs index 08feab1c..cf5adc5b 100644 --- a/Core/Other/Settings/TabSettingsAdvanced.cs +++ b/Dialogs/Settings/TabSettingsAdvanced.cs @@ -2,14 +2,13 @@ using System.Threading.Tasks; using System.Windows.Forms; using TweetDuck.Configuration; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Management; -using TweetDuck.Core.Other.Settings.Dialogs; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Management; +using TweetDuck.Utils; using TweetLib.Core; -namespace TweetDuck.Core.Other.Settings{ - sealed partial class TabSettingsAdvanced : BaseTabSettings{ +namespace TweetDuck.Dialogs.Settings{ + sealed partial class TabSettingsAdvanced : FormSettings.BaseTab{ private readonly Action<string> reinjectBrowserCSS; private readonly Action openDevTools; diff --git a/Core/Other/Settings/TabSettingsFeedback.Designer.cs b/Dialogs/Settings/TabSettingsFeedback.Designer.cs similarity index 99% rename from Core/Other/Settings/TabSettingsFeedback.Designer.cs rename to Dialogs/Settings/TabSettingsFeedback.Designer.cs index 724b474c..eacb03f5 100644 --- a/Core/Other/Settings/TabSettingsFeedback.Designer.cs +++ b/Dialogs/Settings/TabSettingsFeedback.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings { +namespace TweetDuck.Dialogs.Settings { partial class TabSettingsFeedback { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/TabSettingsFeedback.cs b/Dialogs/Settings/TabSettingsFeedback.cs similarity index 91% rename from Core/Other/Settings/TabSettingsFeedback.cs rename to Dialogs/Settings/TabSettingsFeedback.cs index 5979323e..71fdafcf 100644 --- a/Core/Other/Settings/TabSettingsFeedback.cs +++ b/Dialogs/Settings/TabSettingsFeedback.cs @@ -1,12 +1,11 @@ using System; using System.Windows.Forms; -using TweetDuck.Core.Other.Analytics; -using TweetDuck.Core.Other.Settings.Dialogs; -using TweetDuck.Core.Utils; +using TweetDuck.Management.Analytics; +using TweetDuck.Utils; using TweetLib.Core.Features.Plugins; -namespace TweetDuck.Core.Other.Settings{ - sealed partial class TabSettingsFeedback : BaseTabSettings{ +namespace TweetDuck.Dialogs.Settings{ + sealed partial class TabSettingsFeedback : FormSettings.BaseTab{ private readonly AnalyticsFile analyticsFile; private readonly AnalyticsReportGenerator.ExternalInfo analyticsInfo; private readonly PluginManager plugins; diff --git a/Core/Other/Settings/TabSettingsGeneral.Designer.cs b/Dialogs/Settings/TabSettingsGeneral.Designer.cs similarity index 99% rename from Core/Other/Settings/TabSettingsGeneral.Designer.cs rename to Dialogs/Settings/TabSettingsGeneral.Designer.cs index 2e7beb3b..b6a9fff7 100644 --- a/Core/Other/Settings/TabSettingsGeneral.Designer.cs +++ b/Dialogs/Settings/TabSettingsGeneral.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings { +namespace TweetDuck.Dialogs.Settings { partial class TabSettingsGeneral { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/TabSettingsGeneral.cs b/Dialogs/Settings/TabSettingsGeneral.cs similarity index 98% rename from Core/Other/Settings/TabSettingsGeneral.cs rename to Dialogs/Settings/TabSettingsGeneral.cs index 9625404f..fbebaef7 100644 --- a/Core/Other/Settings/TabSettingsGeneral.cs +++ b/Dialogs/Settings/TabSettingsGeneral.cs @@ -2,15 +2,14 @@ using System.IO; using System.Linq; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Other.Settings.Dialogs; -using TweetDuck.Core.Utils; +using TweetDuck.Browser.Handling.General; +using TweetDuck.Controls; +using TweetDuck.Utils; using TweetLib.Core.Features.Updates; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Other.Settings{ - sealed partial class TabSettingsGeneral : BaseTabSettings{ +namespace TweetDuck.Dialogs.Settings{ + sealed partial class TabSettingsGeneral : FormSettings.BaseTab{ private readonly Action reloadColumns; private readonly UpdateHandler updates; diff --git a/Core/Other/Settings/TabSettingsNotifications.Designer.cs b/Dialogs/Settings/TabSettingsNotifications.Designer.cs similarity index 98% rename from Core/Other/Settings/TabSettingsNotifications.Designer.cs rename to Dialogs/Settings/TabSettingsNotifications.Designer.cs index b69e97c0..bbb1c9cb 100644 --- a/Core/Other/Settings/TabSettingsNotifications.Designer.cs +++ b/Dialogs/Settings/TabSettingsNotifications.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings { +namespace TweetDuck.Dialogs.Settings { partial class TabSettingsNotifications { /// <summary> /// Required designer variable. @@ -35,9 +35,9 @@ private void InitializeComponent() { this.radioLocTL = new System.Windows.Forms.RadioButton(); this.trackBarEdgeDistance = new System.Windows.Forms.TrackBar(); this.tableLayoutDurationButtons = new System.Windows.Forms.TableLayoutPanel(); - this.btnDurationMedium = new TweetDuck.Core.Controls.FlatButton(); - this.btnDurationLong = new TweetDuck.Core.Controls.FlatButton(); - this.btnDurationShort = new TweetDuck.Core.Controls.FlatButton(); + this.btnDurationMedium = new TweetDuck.Controls.FlatButton(); + this.btnDurationLong = new TweetDuck.Controls.FlatButton(); + this.btnDurationShort = new TweetDuck.Controls.FlatButton(); this.labelDurationValue = new System.Windows.Forms.Label(); this.trackBarDuration = new System.Windows.Forms.TrackBar(); this.checkSkipOnLinkClick = new System.Windows.Forms.CheckBox(); @@ -652,9 +652,9 @@ private void InitializeComponent() { private System.Windows.Forms.Label labelDurationValue; private System.Windows.Forms.TrackBar trackBarDuration; private System.Windows.Forms.TableLayoutPanel tableLayoutDurationButtons; - private TweetDuck.Core.Controls.FlatButton btnDurationMedium; - private TweetDuck.Core.Controls.FlatButton btnDurationLong; - private TweetDuck.Core.Controls.FlatButton btnDurationShort; + private TweetDuck.Controls.FlatButton btnDurationMedium; + private TweetDuck.Controls.FlatButton btnDurationLong; + private TweetDuck.Controls.FlatButton btnDurationShort; private System.Windows.Forms.CheckBox checkNonIntrusive; private System.Windows.Forms.Label labelIdlePause; private System.Windows.Forms.ComboBox comboBoxIdlePause; diff --git a/Core/Other/Settings/TabSettingsNotifications.cs b/Dialogs/Settings/TabSettingsNotifications.cs similarity index 98% rename from Core/Other/Settings/TabSettingsNotifications.cs rename to Dialogs/Settings/TabSettingsNotifications.cs index 37af32c7..2c42227a 100644 --- a/Core/Other/Settings/TabSettingsNotifications.cs +++ b/Dialogs/Settings/TabSettingsNotifications.cs @@ -1,11 +1,11 @@ using System; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Notification.Example; +using TweetDuck.Browser.Notification.Example; +using TweetDuck.Controls; using TweetLib.Core.Features.Notifications; -namespace TweetDuck.Core.Other.Settings{ - sealed partial class TabSettingsNotifications : BaseTabSettings{ +namespace TweetDuck.Dialogs.Settings{ + sealed partial class TabSettingsNotifications : FormSettings.BaseTab{ private static readonly int[] IdlePauseSeconds = { 0, 30, 60, 120, 300 }; private readonly FormNotificationExample notification; diff --git a/Core/Other/Settings/TabSettingsSounds.Designer.cs b/Dialogs/Settings/TabSettingsSounds.Designer.cs similarity index 99% rename from Core/Other/Settings/TabSettingsSounds.Designer.cs rename to Dialogs/Settings/TabSettingsSounds.Designer.cs index 74d7e46e..bbe28dd0 100644 --- a/Core/Other/Settings/TabSettingsSounds.Designer.cs +++ b/Dialogs/Settings/TabSettingsSounds.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings { +namespace TweetDuck.Dialogs.Settings { partial class TabSettingsSounds { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/TabSettingsSounds.cs b/Dialogs/Settings/TabSettingsSounds.cs similarity index 94% rename from Core/Other/Settings/TabSettingsSounds.cs rename to Dialogs/Settings/TabSettingsSounds.cs index 3f5b7148..a12ee40f 100644 --- a/Core/Other/Settings/TabSettingsSounds.cs +++ b/Dialogs/Settings/TabSettingsSounds.cs @@ -2,12 +2,12 @@ using System.Drawing; using System.IO; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Notification; -using TweetDuck.Core.Utils; +using TweetDuck.Browser.Notification; +using TweetDuck.Controls; +using TweetDuck.Utils; -namespace TweetDuck.Core.Other.Settings{ - sealed partial class TabSettingsSounds : BaseTabSettings{ +namespace TweetDuck.Dialogs.Settings{ + sealed partial class TabSettingsSounds : FormSettings.BaseTab{ private readonly Action playSoundNotification; public TabSettingsSounds(Action playSoundNotification){ diff --git a/Core/Other/Settings/TabSettingsTray.Designer.cs b/Dialogs/Settings/TabSettingsTray.Designer.cs similarity index 99% rename from Core/Other/Settings/TabSettingsTray.Designer.cs rename to Dialogs/Settings/TabSettingsTray.Designer.cs index dc852174..50384c9c 100644 --- a/Core/Other/Settings/TabSettingsTray.Designer.cs +++ b/Dialogs/Settings/TabSettingsTray.Designer.cs @@ -1,4 +1,4 @@ -namespace TweetDuck.Core.Other.Settings { +namespace TweetDuck.Dialogs.Settings { partial class TabSettingsTray { /// <summary> /// Required designer variable. diff --git a/Core/Other/Settings/TabSettingsTray.cs b/Dialogs/Settings/TabSettingsTray.cs similarity index 93% rename from Core/Other/Settings/TabSettingsTray.cs rename to Dialogs/Settings/TabSettingsTray.cs index d885236c..a4b44720 100644 --- a/Core/Other/Settings/TabSettingsTray.cs +++ b/Dialogs/Settings/TabSettingsTray.cs @@ -1,7 +1,8 @@ using System; +using TweetDuck.Browser; -namespace TweetDuck.Core.Other.Settings{ - sealed partial class TabSettingsTray : BaseTabSettings{ +namespace TweetDuck.Dialogs.Settings{ + sealed partial class TabSettingsTray : FormSettings.BaseTab{ public TabSettingsTray(){ InitializeComponent(); diff --git a/Core/Other/Analytics/AnalyticsFile.cs b/Management/Analytics/AnalyticsFile.cs similarity index 99% rename from Core/Other/Analytics/AnalyticsFile.cs rename to Management/Analytics/AnalyticsFile.cs index 72b6c8e8..5933789f 100644 --- a/Core/Other/Analytics/AnalyticsFile.cs +++ b/Management/Analytics/AnalyticsFile.cs @@ -5,7 +5,7 @@ using TweetLib.Core.Serialization; using TweetLib.Core.Serialization.Converters; -namespace TweetDuck.Core.Other.Analytics{ +namespace TweetDuck.Management.Analytics{ [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Local")] sealed class AnalyticsFile{ private static readonly FileSerializer<AnalyticsFile> Serializer = new FileSerializer<AnalyticsFile>(); diff --git a/Core/Other/Analytics/AnalyticsManager.cs b/Management/Analytics/AnalyticsManager.cs similarity index 98% rename from Core/Other/Analytics/AnalyticsManager.cs rename to Management/Analytics/AnalyticsManager.cs index ca90e7ad..c3d61aa4 100644 --- a/Core/Other/Analytics/AnalyticsManager.cs +++ b/Management/Analytics/AnalyticsManager.cs @@ -6,13 +6,14 @@ using System.Net; using System.Threading.Tasks; using System.Timers; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; +using TweetDuck.Browser; +using TweetDuck.Controls; +using TweetDuck.Utils; using TweetLib.Core; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Other.Analytics{ +namespace TweetDuck.Management.Analytics{ sealed class AnalyticsManager : IDisposable{ private static readonly TimeSpan CollectionInterval = TimeSpan.FromDays(14); diff --git a/Core/Other/Analytics/AnalyticsReport.cs b/Management/Analytics/AnalyticsReport.cs similarity index 97% rename from Core/Other/Analytics/AnalyticsReport.cs rename to Management/Analytics/AnalyticsReport.cs index 91a61ec1..61a3b5b2 100644 --- a/Core/Other/Analytics/AnalyticsReport.cs +++ b/Management/Analytics/AnalyticsReport.cs @@ -2,7 +2,7 @@ using System.Collections.Specialized; using System.Text; -namespace TweetDuck.Core.Other.Analytics{ +namespace TweetDuck.Management.Analytics{ sealed class AnalyticsReport : IEnumerable{ private OrderedDictionary data = new OrderedDictionary(32); private int separators; diff --git a/Core/Other/Analytics/AnalyticsReportGenerator.cs b/Management/Analytics/AnalyticsReportGenerator.cs similarity index 99% rename from Core/Other/Analytics/AnalyticsReportGenerator.cs rename to Management/Analytics/AnalyticsReportGenerator.cs index ff264ef0..496070a8 100644 --- a/Core/Other/Analytics/AnalyticsReportGenerator.cs +++ b/Management/Analytics/AnalyticsReportGenerator.cs @@ -2,20 +2,21 @@ using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Windows.Forms; -using Microsoft.Win32; -using TweetDuck.Configuration; using System.Linq; using System.Management; using System.Text.RegularExpressions; -using TweetDuck.Core.Utils; +using System.Windows.Forms; +using Microsoft.Win32; +using TweetDuck.Browser; +using TweetDuck.Configuration; +using TweetDuck.Utils; using TweetLib.Core; using TweetLib.Core.Features.Notifications; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Enums; using TweetLib.Core.Utils; -namespace TweetDuck.Core.Other.Analytics{ +namespace TweetDuck.Management.Analytics{ static class AnalyticsReportGenerator{ public static AnalyticsReport Create(AnalyticsFile file, ExternalInfo info, PluginManager plugins){ Dictionary<string, string> editLayoutDesign = EditLayoutDesignPluginData; diff --git a/Core/Management/BrowserCache.cs b/Management/BrowserCache.cs similarity index 98% rename from Core/Management/BrowserCache.cs rename to Management/BrowserCache.cs index d580934b..68bd311f 100644 --- a/Core/Management/BrowserCache.cs +++ b/Management/BrowserCache.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace TweetDuck.Core.Management{ +namespace TweetDuck.Management{ static class BrowserCache{ public static string CacheFolder => Path.Combine(Program.StoragePath, "Cache"); diff --git a/Core/FormManager.cs b/Management/FormManager.cs similarity index 68% rename from Core/FormManager.cs rename to Management/FormManager.cs index c3bd1725..bb96955e 100644 --- a/Core/FormManager.cs +++ b/Management/FormManager.cs @@ -1,10 +1,12 @@ using System.Linq; using System.Windows.Forms; -namespace TweetDuck.Core{ +namespace TweetDuck.Management{ static class FormManager{ + private static FormCollection OpenForms => System.Windows.Forms.Application.OpenForms; + public static T TryFind<T>() where T : Form{ - return Application.OpenForms.OfType<T>().FirstOrDefault(); + return OpenForms.OfType<T>().FirstOrDefault(); } public static bool TryBringToFront<T>() where T : Form{ @@ -20,7 +22,7 @@ public static bool TryBringToFront<T>() where T : Form{ } public static void CloseAllDialogs(){ - foreach(IAppDialog dialog in Application.OpenForms.OfType<IAppDialog>().Reverse()){ + foreach(IAppDialog dialog in OpenForms.OfType<IAppDialog>().Reverse()){ ((Form)dialog).Close(); } } diff --git a/Core/Management/ProfileManager.cs b/Management/ProfileManager.cs similarity index 99% rename from Core/Management/ProfileManager.cs rename to Management/ProfileManager.cs index 868e8e98..0dfaa5e7 100644 --- a/Core/Management/ProfileManager.cs +++ b/Management/ProfileManager.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using TweetDuck.Core.Other; +using TweetDuck.Dialogs; using TweetLib.Core.Data; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Enums; -namespace TweetDuck.Core.Management{ +namespace TweetDuck.Management{ sealed class ProfileManager{ private static readonly string CookiesPath = Path.Combine(Program.StoragePath, "Cookies"); private static readonly string TempCookiesPath = Path.Combine(Program.StoragePath, "CookiesTmp"); diff --git a/Core/Management/VideoPlayer.cs b/Management/VideoPlayer.cs similarity index 98% rename from Core/Management/VideoPlayer.cs rename to Management/VideoPlayer.cs index f35fb5f8..d7dad0ac 100644 --- a/Core/Management/VideoPlayer.cs +++ b/Management/VideoPlayer.cs @@ -2,13 +2,14 @@ using System.Diagnostics; using System.IO; using System.Windows.Forms; +using TweetDuck.Browser; using TweetDuck.Configuration; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Dialogs; +using TweetDuck.Utils; using TweetLib.Communication; -namespace TweetDuck.Core.Management{ +namespace TweetDuck.Management{ sealed class VideoPlayer : IDisposable{ private static UserConfig Config => Program.Config.User; diff --git a/Plugins/PluginControl.Designer.cs b/Plugins/PluginControl.Designer.cs index bcbefa2f..fb4898c4 100644 --- a/Plugins/PluginControl.Designer.cs +++ b/Plugins/PluginControl.Designer.cs @@ -33,7 +33,7 @@ private void InitializeComponent() { this.labelWebsite = new System.Windows.Forms.Label(); this.labelVersion = new System.Windows.Forms.Label(); this.btnConfigure = new System.Windows.Forms.Button(); - this.labelType = new TweetDuck.Core.Controls.LabelVertical(); + this.labelType = new TweetDuck.Controls.LabelVertical(); this.timerLayout = new System.Windows.Forms.Timer(this.components); this.panelBorder = new System.Windows.Forms.Panel(); this.panelDescription.SuspendLayout(); @@ -227,7 +227,7 @@ private void InitializeComponent() { private System.Windows.Forms.Label labelWebsite; private System.Windows.Forms.Label labelVersion; private System.Windows.Forms.Button btnConfigure; - private Core.Controls.LabelVertical labelType; + private Controls.LabelVertical labelType; private System.Windows.Forms.Timer timerLayout; private System.Windows.Forms.Panel panelBorder; } diff --git a/Plugins/PluginControl.cs b/Plugins/PluginControl.cs index 28fc60a3..2403260d 100644 --- a/Plugins/PluginControl.cs +++ b/Plugins/PluginControl.cs @@ -1,8 +1,8 @@ using System; using System.Drawing; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Utils; +using TweetDuck.Controls; +using TweetDuck.Utils; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Enums; diff --git a/Plugins/PluginDispatcher.cs b/Plugins/PluginDispatcher.cs index 5e47eef4..e184f7a5 100644 --- a/Plugins/PluginDispatcher.cs +++ b/Plugins/PluginDispatcher.cs @@ -1,6 +1,6 @@ using System; using CefSharp; -using TweetDuck.Core.Adapters; +using TweetDuck.Browser.Adapters; using TweetLib.Core.Browser; using TweetLib.Core.Features.Plugins; using TweetLib.Core.Features.Plugins.Events; diff --git a/Program.cs b/Program.cs index d3b8d1ce..1360e7f6 100644 --- a/Program.cs +++ b/Program.cs @@ -4,20 +4,20 @@ using System.Diagnostics; using System.IO; using System.Linq; -using System.Windows.Forms; +using TweetDuck.Application; +using TweetDuck.Browser; +using TweetDuck.Browser.Handling; +using TweetDuck.Browser.Handling.General; using TweetDuck.Configuration; -using TweetDuck.Core; -using TweetDuck.Core.Handling; -using TweetDuck.Core.Handling.General; -using TweetDuck.Core.Other; -using TweetDuck.Core.Management; -using TweetDuck.Core.Utils; -using TweetDuck.Impl; +using TweetDuck.Dialogs; +using TweetDuck.Management; using TweetDuck.Resources; +using TweetDuck.Utils; using TweetLib.Core; using TweetLib.Core.Application.Helpers; using TweetLib.Core.Collections; using TweetLib.Core.Utils; +using Win = System.Windows.Forms; namespace TweetDuck{ static class Program{ @@ -27,6 +27,8 @@ static class Program{ public const string Website = "https://tweetduck.chylex.com"; public static readonly string ProgramPath = AppDomain.CurrentDomain.BaseDirectory; + public static readonly string ExecutablePath = Win.Application.ExecutablePath; + public static readonly bool IsPortable = File.Exists(Path.Combine(ProgramPath, "makeportable")); public static readonly string ScriptPath = Path.Combine(ProgramPath, "scripts"); @@ -75,10 +77,14 @@ static Program(){ }); } + internal static void SetupWinForms(){ + Win.Application.EnableVisualStyles(); + Win.Application.SetCompatibleTextRenderingDefault(false); + } + [STAThread] private static void Main(){ - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); + SetupWinForms(); Cef.EnableHighDPISupport(); WindowRestoreMessage = NativeMethods.RegisterWindowMessage("TweetDuckRestore"); @@ -168,11 +174,11 @@ private static void Main(){ Cef.Initialize(settings, false, new BrowserProcessHandler()); - Application.ApplicationExit += (sender, args) => ExitCleanup(); + Win.Application.ApplicationExit += (sender, args) => ExitCleanup(); FormBrowser mainForm = new FormBrowser(); Resources.Initialize(mainForm); - Application.Run(mainForm); + Win.Application.Run(mainForm); if (mainForm.UpdateInstallerPath != null){ ExitCleanup(); @@ -182,7 +188,7 @@ private static void Main(){ bool runElevated = !IsPortable || !FileUtils.CheckFolderWritePermission(ProgramPath); if (WindowsUtils.OpenAssociatedProgram(mainForm.UpdateInstallerPath, updaterArgs, runElevated)){ - Application.Exit(); + Win.Application.Exit(); } else{ RestartWithArgsInternal(Arguments.GetCurrentClean()); @@ -227,8 +233,8 @@ public static void RestartWithArgs(CommandLineArgs args){ private static void RestartWithArgsInternal(CommandLineArgs args){ args.AddFlag(Arguments.ArgRestart); - Process.Start(Application.ExecutablePath, args.ToString()); - Application.Exit(); + Process.Start(ExecutablePath, args.ToString()); + Win.Application.Exit(); } private static void ExitCleanup(){ diff --git a/Reporter.cs b/Reporter.cs index 841e879e..7a6b5cf4 100644 --- a/Reporter.cs +++ b/Reporter.cs @@ -5,7 +5,7 @@ using System.Text; using System.Windows.Forms; using TweetDuck.Configuration; -using TweetDuck.Core.Other; +using TweetDuck.Dialogs; using TweetLib.Core; using TweetLib.Core.Application; @@ -96,9 +96,7 @@ public void HandleException(string caption, string message, bool canIgnore, Exce } public static void HandleEarlyFailure(string caption, string message){ - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - + Program.SetupWinForms(); FormMessage.Error(caption, message, "Exit"); try{ diff --git a/Resources/ScriptLoader.cs b/Resources/ScriptLoader.cs index 46add6eb..6ac545fd 100644 --- a/Resources/ScriptLoader.cs +++ b/Resources/ScriptLoader.cs @@ -3,8 +3,8 @@ using System.IO; using System.Text; using System.Windows.Forms; -using TweetDuck.Core.Controls; -using TweetDuck.Core.Other; +using TweetDuck.Controls; +using TweetDuck.Dialogs; using TweetLib.Core.Application; namespace TweetDuck.Resources{ diff --git a/Resources/ScriptLoaderDebug.cs b/Resources/ScriptLoaderDebug.cs index 96a81a13..f39c56f1 100644 --- a/Resources/ScriptLoaderDebug.cs +++ b/Resources/ScriptLoaderDebug.cs @@ -3,8 +3,8 @@ using System.Diagnostics; using System.IO; using System.Reflection; -using System.Windows.Forms; -using TweetDuck.Core; +using TweetDuck.Browser; +using TweetDuck.Management; using TweetLib.Core.Features.Plugins; namespace TweetDuck.Resources{ @@ -22,7 +22,7 @@ public ScriptLoaderDebug(){ Debug.WriteLine("Activating resource hot swap..."); ResetHotSwap(); - Application.ApplicationExit += (sender, args) => ResetHotSwap(); + System.Windows.Forms.Application.ApplicationExit += (sender, args) => ResetHotSwap(); } } diff --git a/TweetDuck.csproj b/TweetDuck.csproj index b9869ba2..bdc55b4b 100644 --- a/TweetDuck.csproj +++ b/TweetDuck.csproj @@ -57,200 +57,197 @@ <Compile Include="Configuration\ConfigManager.cs" /> <Compile Include="Configuration\SystemConfig.cs" /> <Compile Include="Configuration\UserConfig.cs" /> - <Compile Include="Core\Adapters\CefScriptExecutor.cs" /> - <Compile Include="Core\Bridge\PropertyBridge.cs" /> - <Compile Include="Core\Bridge\UpdateBridge.cs" /> - <Compile Include="Core\Controls\ControlExtensions.cs" /> - <Compile Include="Core\Controls\FlatButton.cs"> + <Compile Include="Browser\Adapters\CefScriptExecutor.cs" /> + <Compile Include="Browser\Bridge\PropertyBridge.cs" /> + <Compile Include="Browser\Bridge\UpdateBridge.cs" /> + <Compile Include="Controls\ControlExtensions.cs" /> + <Compile Include="Controls\FlatButton.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Core\Controls\FlatProgressBar.cs"> + <Compile Include="Controls\FlatProgressBar.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Core\Controls\LabelVertical.cs"> + <Compile Include="Controls\LabelVertical.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Core\Controls\NumericUpDownEx.cs"> + <Compile Include="Controls\NumericUpDownEx.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Core\FormManager.cs" /> - <Compile Include="Core\Handling\ContextMenuGuide.cs" /> - <Compile Include="Core\Handling\DragHandlerBrowser.cs" /> - <Compile Include="Core\Handling\Filters\ResponseFilterBase.cs" /> - <Compile Include="Core\Handling\Filters\ResponseFilterVendor.cs" /> - <Compile Include="Core\Handling\General\BrowserProcessHandler.cs" /> - <Compile Include="Core\Handling\ContextMenuBase.cs" /> - <Compile Include="Core\Handling\ContextMenuBrowser.cs" /> - <Compile Include="Core\FormBrowser.cs"> + <Compile Include="Management\FormManager.cs" /> + <Compile Include="Browser\Handling\ContextMenuGuide.cs" /> + <Compile Include="Browser\Handling\DragHandlerBrowser.cs" /> + <Compile Include="Browser\Handling\Filters\ResponseFilterBase.cs" /> + <Compile Include="Browser\Handling\Filters\ResponseFilterVendor.cs" /> + <Compile Include="Browser\Handling\General\BrowserProcessHandler.cs" /> + <Compile Include="Browser\Handling\ContextMenuBase.cs" /> + <Compile Include="Browser\Handling\ContextMenuBrowser.cs" /> + <Compile Include="Browser\FormBrowser.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\FormBrowser.Designer.cs"> + <Compile Include="Browser\FormBrowser.Designer.cs"> <DependentUpon>FormBrowser.cs</DependentUpon> </Compile> - <Compile Include="Core\Handling\General\FileDialogHandler.cs" /> - <Compile Include="Core\Handling\KeyboardHandlerBase.cs" /> - <Compile Include="Core\Handling\KeyboardHandlerBrowser.cs" /> - <Compile Include="Core\Handling\KeyboardHandlerNotification.cs" /> - <Compile Include="Core\Handling\RequestHandlerBase.cs" /> - <Compile Include="Core\Handling\RequestHandlerBrowser.cs" /> - <Compile Include="Core\Handling\ResourceHandlerFactory.cs" /> - <Compile Include="Core\Handling\ResourceHandlerNotification.cs" /> - <Compile Include="Core\Management\ContextInfo.cs" /> - <Compile Include="Core\Notification\Example\FormNotificationExample.cs"> + <Compile Include="Browser\Handling\General\FileDialogHandler.cs" /> + <Compile Include="Browser\Handling\KeyboardHandlerBase.cs" /> + <Compile Include="Browser\Handling\KeyboardHandlerBrowser.cs" /> + <Compile Include="Browser\Handling\KeyboardHandlerNotification.cs" /> + <Compile Include="Browser\Handling\RequestHandlerBase.cs" /> + <Compile Include="Browser\Handling\RequestHandlerBrowser.cs" /> + <Compile Include="Browser\Handling\ResourceHandlerFactory.cs" /> + <Compile Include="Browser\Handling\ResourceHandlerNotification.cs" /> + <Compile Include="Browser\Data\ContextInfo.cs" /> + <Compile Include="Browser\Notification\Example\FormNotificationExample.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Notification\FormNotificationMain.cs"> + <Compile Include="Browser\Notification\FormNotificationMain.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Notification\FormNotificationMain.Designer.cs"> + <Compile Include="Browser\Notification\FormNotificationMain.Designer.cs"> <DependentUpon>FormNotificationMain.cs</DependentUpon> </Compile> - <Compile Include="Core\Notification\FormNotificationBase.cs"> + <Compile Include="Browser\Notification\FormNotificationBase.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Notification\FormNotificationBase.Designer.cs"> + <Compile Include="Browser\Notification\FormNotificationBase.Designer.cs"> <DependentUpon>FormNotificationBase.cs</DependentUpon> </Compile> - <Compile Include="Core\Handling\ContextMenuNotification.cs" /> - <Compile Include="Core\Handling\General\JavaScriptDialogHandler.cs" /> - <Compile Include="Core\Handling\General\LifeSpanHandler.cs" /> - <Compile Include="Core\Notification\FormNotificationTweet.cs"> + <Compile Include="Browser\Handling\ContextMenuNotification.cs" /> + <Compile Include="Browser\Handling\General\JavaScriptDialogHandler.cs" /> + <Compile Include="Browser\Handling\General\LifeSpanHandler.cs" /> + <Compile Include="Browser\Notification\FormNotificationTweet.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Notification\FormNotificationTweet.Designer.cs"> + <Compile Include="Browser\Notification\FormNotificationTweet.Designer.cs"> <DependentUpon>FormNotificationTweet.cs</DependentUpon> </Compile> - <Compile Include="Core\Notification\SoundNotification.cs" /> - <Compile Include="Core\Other\Analytics\AnalyticsFile.cs" /> - <Compile Include="Core\Other\Analytics\AnalyticsManager.cs" /> - <Compile Include="Core\Other\Analytics\AnalyticsReport.cs" /> - <Compile Include="Core\Other\Analytics\AnalyticsReportGenerator.cs" /> - <Compile Include="Core\Other\FormAbout.cs"> + <Compile Include="Browser\Notification\SoundNotification.cs" /> + <Compile Include="Management\Analytics\AnalyticsFile.cs" /> + <Compile Include="Management\Analytics\AnalyticsManager.cs" /> + <Compile Include="Management\Analytics\AnalyticsReport.cs" /> + <Compile Include="Management\Analytics\AnalyticsReportGenerator.cs" /> + <Compile Include="Dialogs\FormAbout.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\FormAbout.Designer.cs"> + <Compile Include="Dialogs\FormAbout.Designer.cs"> <DependentUpon>FormAbout.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\FormGuide.cs"> + <Compile Include="Dialogs\FormGuide.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\FormGuide.Designer.cs"> + <Compile Include="Dialogs\FormGuide.Designer.cs"> <DependentUpon>FormGuide.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\FormMessage.cs"> + <Compile Include="Dialogs\FormMessage.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\FormMessage.Designer.cs"> + <Compile Include="Dialogs\FormMessage.Designer.cs"> <DependentUpon>FormMessage.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\FormPlugins.cs"> + <Compile Include="Dialogs\FormPlugins.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\FormPlugins.Designer.cs"> + <Compile Include="Dialogs\FormPlugins.Designer.cs"> <DependentUpon>FormPlugins.cs</DependentUpon> </Compile> - <Compile Include="Core\Management\VideoPlayer.cs" /> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsAnalytics.cs"> + <Compile Include="Management\VideoPlayer.cs" /> + <Compile Include="Dialogs\Settings\DialogSettingsAnalytics.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsAnalytics.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsAnalytics.Designer.cs"> <DependentUpon>DialogSettingsAnalytics.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsExternalProgram.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsExternalProgram.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsExternalProgram.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsExternalProgram.Designer.cs"> <DependentUpon>DialogSettingsExternalProgram.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsSearchEngine.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsSearchEngine.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsSearchEngine.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsSearchEngine.Designer.cs"> <DependentUpon>DialogSettingsSearchEngine.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsCSS.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsCSS.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsCSS.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsCSS.Designer.cs"> <DependentUpon>DialogSettingsCSS.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsCefArgs.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsCefArgs.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsCefArgs.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsCefArgs.Designer.cs"> <DependentUpon>DialogSettingsCefArgs.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsManage.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsManage.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsManage.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsManage.Designer.cs"> <DependentUpon>DialogSettingsManage.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsRestart.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsRestart.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\Settings\Dialogs\DialogSettingsRestart.Designer.cs"> + <Compile Include="Dialogs\Settings\DialogSettingsRestart.Designer.cs"> <DependentUpon>DialogSettingsRestart.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsFeedback.cs"> + <Compile Include="Dialogs\Settings\TabSettingsFeedback.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsFeedback.Designer.cs"> + <Compile Include="Dialogs\Settings\TabSettingsFeedback.Designer.cs"> <DependentUpon>TabSettingsFeedback.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsTray.cs"> + <Compile Include="Dialogs\Settings\TabSettingsTray.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsTray.Designer.cs"> + <Compile Include="Dialogs\Settings\TabSettingsTray.Designer.cs"> <DependentUpon>TabSettingsTray.cs</DependentUpon> </Compile> - <Compile Include="Core\TweetDeckBrowser.cs" /> - <Compile Include="Core\Utils\TwitterUtils.cs" /> - <Compile Include="Core\Management\ProfileManager.cs" /> - <Compile Include="Core\Other\Settings\TabSettingsAdvanced.cs"> + <Compile Include="Browser\TweetDeckBrowser.cs" /> + <Compile Include="Utils\TwitterUtils.cs" /> + <Compile Include="Management\ProfileManager.cs" /> + <Compile Include="Dialogs\Settings\TabSettingsAdvanced.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsAdvanced.Designer.cs"> + <Compile Include="Dialogs\Settings\TabSettingsAdvanced.Designer.cs"> <DependentUpon>TabSettingsAdvanced.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\BaseTabSettings.cs"> + <Compile Include="Dialogs\Settings\TabSettingsGeneral.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsGeneral.cs"> - <SubType>UserControl</SubType> - </Compile> - <Compile Include="Core\Other\Settings\TabSettingsGeneral.Designer.cs"> + <Compile Include="Dialogs\Settings\TabSettingsGeneral.Designer.cs"> <DependentUpon>TabSettingsGeneral.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsSounds.cs"> + <Compile Include="Dialogs\Settings\TabSettingsSounds.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsSounds.Designer.cs"> + <Compile Include="Dialogs\Settings\TabSettingsSounds.Designer.cs"> <DependentUpon>TabSettingsSounds.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsNotifications.cs"> + <Compile Include="Dialogs\Settings\TabSettingsNotifications.cs"> <SubType>UserControl</SubType> </Compile> - <Compile Include="Core\Other\Settings\TabSettingsNotifications.Designer.cs"> + <Compile Include="Dialogs\Settings\TabSettingsNotifications.Designer.cs"> <DependentUpon>TabSettingsNotifications.cs</DependentUpon> </Compile> - <Compile Include="Core\Notification\Screenshot\ScreenshotBridge.cs" /> - <Compile Include="Core\Notification\Screenshot\FormNotificationScreenshotable.cs"> + <Compile Include="Browser\Notification\Screenshot\ScreenshotBridge.cs" /> + <Compile Include="Browser\Notification\Screenshot\FormNotificationScreenshotable.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Notification\Screenshot\TweetScreenshotManager.cs" /> - <Compile Include="Data\ResourceLink.cs" /> - <Compile Include="Data\WindowState.cs" /> - <Compile Include="Core\Utils\WindowsUtils.cs" /> - <Compile Include="Core\Bridge\TweetDeckBridge.cs" /> - <Compile Include="Core\Other\FormSettings.cs"> + <Compile Include="Browser\Notification\Screenshot\TweetScreenshotManager.cs" /> + <Compile Include="Browser\Data\ResourceLink.cs" /> + <Compile Include="Browser\Data\WindowState.cs" /> + <Compile Include="Utils\WindowsUtils.cs" /> + <Compile Include="Browser\Bridge\TweetDeckBridge.cs" /> + <Compile Include="Dialogs\FormSettings.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Core\Other\FormSettings.Designer.cs"> + <Compile Include="Dialogs\FormSettings.Designer.cs"> <DependentUpon>FormSettings.cs</DependentUpon> </Compile> - <Compile Include="Impl\LockHandler.cs" /> - <Compile Include="Impl\SystemHandler.cs" /> + <Compile Include="Application\LockHandler.cs" /> + <Compile Include="Application\SystemHandler.cs" /> <Compile Include="Plugins\PluginControl.cs"> <SubType>UserControl</SubType> </Compile> @@ -258,7 +255,7 @@ <DependentUpon>PluginControl.cs</DependentUpon> </Compile> <Compile Include="Plugins\PluginDispatcher.cs" /> - <Compile Include="Core\Controls\FlowLayoutPanelNoHScroll.cs"> + <Compile Include="Controls\FlowLayoutPanelNoHScroll.cs"> <SubType>Component</SubType> </Compile> <Compile Include="Configuration\PluginConfig.cs" /> @@ -275,15 +272,15 @@ <Compile Include="Updates\FormUpdateDownload.Designer.cs"> <DependentUpon>FormUpdateDownload.cs</DependentUpon> </Compile> - <Compile Include="Core\Other\TrayIcon.cs"> + <Compile Include="Browser\TrayIcon.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="Core\Other\TrayIcon.Designer.cs"> + <Compile Include="Browser\TrayIcon.Designer.cs"> <DependentUpon>TrayIcon.cs</DependentUpon> </Compile> - <Compile Include="Core\Management\BrowserCache.cs" /> - <Compile Include="Core\Utils\BrowserUtils.cs" /> - <Compile Include="Core\Utils\NativeMethods.cs" /> + <Compile Include="Management\BrowserCache.cs" /> + <Compile Include="Utils\BrowserUtils.cs" /> + <Compile Include="Utils\NativeMethods.cs" /> <Compile Include="Updates\UpdateCheckClient.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> @@ -302,7 +299,7 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="Core\FormBrowser.resx"> + <EmbeddedResource Include="Browser\FormBrowser.resx"> <DependentUpon>FormBrowser.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> diff --git a/Updates/UpdateCheckClient.cs b/Updates/UpdateCheckClient.cs index 4862c07f..fed7eaf0 100644 --- a/Updates/UpdateCheckClient.cs +++ b/Updates/UpdateCheckClient.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.Web.Script.Serialization; -using TweetDuck.Core.Utils; +using TweetDuck.Utils; using TweetLib.Core.Features.Updates; using TweetLib.Core.Utils; using JsonObject = System.Collections.Generic.IDictionary<string, object>; diff --git a/Core/Utils/BrowserUtils.cs b/Utils/BrowserUtils.cs similarity index 97% rename from Core/Utils/BrowserUtils.cs rename to Utils/BrowserUtils.cs index cbb969c4..b5efcb0a 100644 --- a/Core/Utils/BrowserUtils.cs +++ b/Utils/BrowserUtils.cs @@ -1,17 +1,19 @@ -using CefSharp; -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Windows.Forms; +using CefSharp; using CefSharp.WinForms; +using TweetDuck.Browser; using TweetDuck.Configuration; -using TweetDuck.Core.Other; +using TweetDuck.Dialogs; +using TweetDuck.Management; using TweetLib.Core.Features.Twitter; -namespace TweetDuck.Core.Utils{ +namespace TweetDuck.Utils{ static class BrowserUtils{ - public static string UserAgentVanilla => Program.BrandName + " " + Application.ProductVersion; + public static string UserAgentVanilla => Program.BrandName + " " + System.Windows.Forms.Application.ProductVersion; public static string UserAgentChrome => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + Cef.ChromiumVersion + " Safari/537.36"; public static readonly bool HasDevTools = File.Exists(Path.Combine(Program.ProgramPath, "devtools_resources.pak")); diff --git a/Core/Utils/NativeMethods.cs b/Utils/NativeMethods.cs similarity index 99% rename from Core/Utils/NativeMethods.cs rename to Utils/NativeMethods.cs index e3042874..e3eac188 100644 --- a/Core/Utils/NativeMethods.cs +++ b/Utils/NativeMethods.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace TweetDuck.Core.Utils{ +namespace TweetDuck.Utils{ [SuppressMessage("ReSharper", "FieldCanBeMadeReadOnly.Local")] [SuppressMessage("ReSharper", "MemberCanBePrivate.Local")] static class NativeMethods{ diff --git a/Core/Utils/TwitterUtils.cs b/Utils/TwitterUtils.cs similarity index 98% rename from Core/Utils/TwitterUtils.cs rename to Utils/TwitterUtils.cs index 2d1b999d..753d09a0 100644 --- a/Core/Utils/TwitterUtils.cs +++ b/Utils/TwitterUtils.cs @@ -1,19 +1,19 @@ using System; -using CefSharp; using System.Drawing; using System.IO; -using System.Windows.Forms; -using TweetDuck.Core.Management; -using TweetDuck.Core.Other; -using TweetDuck.Data; using System.Linq; using System.Net; using System.Threading.Tasks; +using System.Windows.Forms; +using CefSharp; +using TweetDuck.Browser.Data; +using TweetDuck.Dialogs; +using TweetDuck.Management; using TweetLib.Core.Features.Twitter; using TweetLib.Core.Utils; using Cookie = CefSharp.Cookie; -namespace TweetDuck.Core.Utils{ +namespace TweetDuck.Utils{ static class TwitterUtils{ public static readonly Color BackgroundColor = Color.FromArgb(28, 99, 153); public const string BackgroundColorOverride = "setTimeout(function f(){let h=document.head;if(!h){setTimeout(f,5);return;}let e=document.createElement('style');e.innerHTML='body,body::before{background:#1c6399!important;margin:0}';h.appendChild(e);},1)"; diff --git a/Core/Utils/WindowsUtils.cs b/Utils/WindowsUtils.cs similarity index 99% rename from Core/Utils/WindowsUtils.cs rename to Utils/WindowsUtils.cs index e5814402..90b63ec2 100644 --- a/Core/Utils/WindowsUtils.cs +++ b/Utils/WindowsUtils.cs @@ -9,7 +9,7 @@ using System.Windows.Forms; using Microsoft.Win32; -namespace TweetDuck.Core.Utils{ +namespace TweetDuck.Utils{ static class WindowsUtils{ private static readonly bool IsWindows8OrNewer = OSVersionEquals(major: 6, minor: 2); // windows 8/10