1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-01 08:34:11 +02:00
TweetDuck/Core/Handling/DialogHandlerBrowser.cs

28 lines
943 B
C#

using CefSharp;
using System.Collections.Generic;
using TweetDck.Core.Controls;
namespace TweetDck.Core.Handling{
class DialogHandlerBrowser : IDialogHandler{
private readonly FormBrowser form;
public DialogHandlerBrowser(FormBrowser form){
this.form = form;
}
public bool OnFileDialog(IWebBrowser browserControl, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List<string> acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback){
if (!string.IsNullOrEmpty(TweetDeckBridge.ClipboardImagePath)){
callback.Continue(selectedAcceptFilter, new List<string>{ TweetDeckBridge.ClipboardImagePath });
form.InvokeSafe(() => {
TweetDeckBridge.ClipboardImagePath = string.Empty;
});
return true;
}
return false;
}
}
}