diff --git a/Core/Handling/DragHandlerBrowser.cs b/Core/Handling/DragHandlerBrowser.cs index 7aa2c1d4..9ba0e553 100644 --- a/Core/Handling/DragHandlerBrowser.cs +++ b/Core/Handling/DragHandlerBrowser.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using CefSharp; +using CefSharp.Enums; namespace TweetDuck.Core.Handling{ sealed class DragHandlerBrowser : IDragHandler{ diff --git a/Core/Notification/Example/FormNotificationExample.cs b/Core/Notification/Example/FormNotificationExample.cs index 6e0b12a0..b0938189 100644 --- a/Core/Notification/Example/FormNotificationExample.cs +++ b/Core/Notification/Example/FormNotificationExample.cs @@ -1,4 +1,6 @@ -using System.Windows.Forms; +using System; +using System.Windows.Forms; +using CefSharp; using TweetDuck.Core.Controls; using TweetDuck.Plugins; using TweetDuck.Resources; @@ -21,9 +23,13 @@ protected override FormBorderStyle NotificationBorderStyle{ } } + public event EventHandler Ready; + private readonly TweetNotification exampleNotification; public FormNotificationExample(FormBrowser owner, PluginManager pluginManager) : base(owner, pluginManager, false){ + browser.LoadingStateChanged += browser_LoadingStateChanged; + string exampleTweetHTML = ScriptLoader.LoadResource("pages/example.html", true)?.Replace("{avatar}", TweetNotification.AppLogo.Url) ?? string.Empty; #if DEBUG @@ -33,6 +39,13 @@ public FormNotificationExample(FormBrowser owner, PluginManager pluginManager) : exampleNotification = TweetNotification.Example(exampleTweetHTML, 176); } + private void browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e){ + if (!e.IsLoading){ + Ready?.Invoke(this, EventArgs.Empty); + browser.LoadingStateChanged -= browser_LoadingStateChanged; + } + } + public override void HideNotification(){ Location = ControlExtensions.InvisibleLocation; } diff --git a/Core/Notification/FormNotificationBase.cs b/Core/Notification/FormNotificationBase.cs index b3ec3354..1b951ff0 100644 --- a/Core/Notification/FormNotificationBase.cs +++ b/Core/Notification/FormNotificationBase.cs @@ -1,6 +1,4 @@ -using CefSharp; -using CefSharp.WinForms; -using System; +using CefSharp.WinForms; using System.Drawing; using System.Windows.Forms; using TweetDuck.Configuration; @@ -116,8 +114,6 @@ protected virtual FormBorderStyle NotificationBorderStyle{ public bool FreezeTimer { get; set; } public bool ContextMenuOpen { get; set; } - public event EventHandler Initialized; - protected FormNotificationBase(FormBrowser owner, bool enableContextMenu){ InitializeComponent(); @@ -133,7 +129,6 @@ protected FormNotificationBase(FormBrowser owner, bool enableContextMenu){ this.browser.Dock = DockStyle.None; this.browser.ClientSize = ClientSize; - this.browser.IsBrowserInitializedChanged += browser_IsBrowserInitializedChanged; browser.SetupResourceHandler(TwitterUtils.TweetDeckURL, this.resourceHandler); browser.SetupResourceHandler(TweetNotification.AppLogo); @@ -165,12 +160,6 @@ private void owner_FormClosed(object sender, FormClosedEventArgs e){ Close(); } - private void browser_IsBrowserInitializedChanged(object sender, IsBrowserInitializedChangedEventArgs e){ - if (e.IsBrowserInitialized){ - Initialized?.Invoke(this, EventArgs.Empty); - } - } - // notification methods public virtual void HideNotification(){ diff --git a/Core/Other/Settings/TabSettingsNotifications.cs b/Core/Other/Settings/TabSettingsNotifications.cs index 199026f8..978aa144 100644 --- a/Core/Other/Settings/TabSettingsNotifications.cs +++ b/Core/Other/Settings/TabSettingsNotifications.cs @@ -15,7 +15,7 @@ public TabSettingsNotifications(FormNotificationExample notification){ this.notification = notification; - this.notification.Initialized += (sender, args) => { + this.notification.Ready += (sender, args) => { this.InvokeAsyncSafe(() => { this.notification.ShowExampleNotification(true); this.notification.Move += notification_Move; diff --git a/README.md b/README.md index f78d6fd2..d0b20f04 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The program was built using Visual Studio 2017. Before opening the solution, ple After opening the solution, download the following NuGet packages by right-clicking on the solution and selecting **Restore NuGet Packages**, or manually running this command in the **Package Manager Console**: ``` -PM> Install-Package CefSharp.WinForms -Version 64.0.0-CI2508 -Source https://www.myget.org/F/cefsharp/api/v3/index.json +PM> Install-Package CefSharp.WinForms -Version 65.0.0-pre01 ``` Note that some pre-release builds of CefSharp are not available on NuGet. To correctly restore packages in that case, open **Package Manager Settings**, and add `https://www.myget.org/F/cefsharp/api/v3/index.json` to the list of package sources. diff --git a/TweetDuck.csproj b/TweetDuck.csproj index 1fe969c2..21526993 100644 --- a/TweetDuck.csproj +++ b/TweetDuck.csproj @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.props')" /> - <Import Project="packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.props')" /> - <Import Project="packages\cef.redist.x86.3.3282.1731\build\cef.redist.x86.props" Condition="Exists('packages\cef.redist.x86.3.3282.1731\build\cef.redist.x86.props')" /> - <Import Project="packages\cef.redist.x64.3.3282.1731\build\cef.redist.x64.props" Condition="Exists('packages\cef.redist.x64.3.3282.1731\build\cef.redist.x64.props')" /> + <Import Project="packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.props')" /> + <Import Project="packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.props')" /> + <Import Project="packages\cef.redist.x86.3.3325.1758\build\cef.redist.x86.props" Condition="Exists('packages\cef.redist.x86.3.3325.1758\build\cef.redist.x86.props')" /> + <Import Project="packages\cef.redist.x64.3.3325.1758\build\cef.redist.x64.props" Condition="Exists('packages\cef.redist.x64.3.3325.1758\build\cef.redist.x64.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -428,13 +428,13 @@ powershell -ExecutionPolicy Unrestricted -File "$(ProjectDir)Resources\PostBuild <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('packages\cef.redist.x64.3.3282.1731\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.3.3282.1731\build\cef.redist.x64.props'))" /> - <Error Condition="!Exists('packages\cef.redist.x86.3.3282.1731\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.3.3282.1731\build\cef.redist.x86.props'))" /> - <Error Condition="!Exists('packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.props'))" /> - <Error Condition="!Exists('packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.targets'))" /> - <Error Condition="!Exists('packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.props'))" /> - <Error Condition="!Exists('packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.targets'))" /> + <Error Condition="!Exists('packages\cef.redist.x64.3.3325.1758\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.3.3325.1758\build\cef.redist.x64.props'))" /> + <Error Condition="!Exists('packages\cef.redist.x86.3.3325.1758\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.3.3325.1758\build\cef.redist.x86.props'))" /> + <Error Condition="!Exists('packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.props'))" /> + <Error Condition="!Exists('packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.targets'))" /> + <Error Condition="!Exists('packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.props'))" /> + <Error Condition="!Exists('packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.targets'))" /> </Target> - <Import Project="packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.targets')" /> - <Import Project="packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.targets" Condition="Exists('packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.targets')" /> + <Import Project="packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.65.0.0-pre01\build\CefSharp.Common.targets')" /> + <Import Project="packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.targets" Condition="Exists('packages\CefSharp.WinForms.65.0.0-pre01\build\CefSharp.WinForms.targets')" /> </Project> \ No newline at end of file diff --git a/packages.config b/packages.config index 6bc01979..a1c722f7 100644 --- a/packages.config +++ b/packages.config @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="cef.redist.x64" version="3.3282.1731" targetFramework="net452" /> - <package id="cef.redist.x86" version="3.3282.1731" targetFramework="net452" /> - <package id="CefSharp.Common" version="64.0.0-CI2508" targetFramework="net452" /> - <package id="CefSharp.WinForms" version="64.0.0-CI2508" targetFramework="net452" /> + <package id="cef.redist.x64" version="3.3325.1758" targetFramework="net452" /> + <package id="cef.redist.x86" version="3.3325.1758" targetFramework="net452" /> + <package id="CefSharp.Common" version="65.0.0-pre01" targetFramework="net452" /> + <package id="CefSharp.WinForms" version="65.0.0-pre01" targetFramework="net452" /> </packages> \ No newline at end of file diff --git a/subprocess/TweetDuck.Browser.csproj b/subprocess/TweetDuck.Browser.csproj index de8649b7..39d3eb33 100644 --- a/subprocess/TweetDuck.Browser.csproj +++ b/subprocess/TweetDuck.Browser.csproj @@ -26,9 +26,9 @@ <StartupObject /> </PropertyGroup> <ItemGroup> - <Reference Include="CefSharp.BrowserSubprocess.Core, Version=64.0.0.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86"> + <Reference Include="CefSharp.BrowserSubprocess.Core, Version=65.0.0.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\CefSharp.Common.64.0.0-CI2508\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath> + <HintPath>..\packages\CefSharp.Common.65.0.0-pre01\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath> </Reference> <Reference Include="System" /> </ItemGroup>