This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Talk) added download popup and prevent windows notification whil…
…e app is open
- Loading branch information
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using CefSharp; | ||
using System; | ||
|
||
namespace Talk | ||
{ | ||
class MyCustomDownloadHandler : IDownloadHandler | ||
{ | ||
public event EventHandler<DownloadItem> OnBeforeDownloadFired; | ||
|
||
public event EventHandler<DownloadItem> OnDownloadUpdatedFired; | ||
|
||
public void OnBeforeDownload(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback) | ||
{ | ||
OnBeforeDownloadFired?.Invoke(this, downloadItem); | ||
|
||
if (!callback.IsDisposed) | ||
{ | ||
using (callback) | ||
{ | ||
callback.Continue( | ||
downloadItem.SuggestedFileName, | ||
showDialog: true | ||
); | ||
} | ||
} | ||
} | ||
|
||
/// https://cefsharp.github.io/api/51.0.0/html/T_CefSharp_DownloadItem.htm | ||
public void OnDownloadUpdated(IWebBrowser chromiumWebBrowser, IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback) | ||
{ | ||
OnDownloadUpdatedFired?.Invoke(this, downloadItem); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters