1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2024-11-23 17:42:46 +01:00
TweetDuck/windows/TweetImpl.CefSharp/Adapters/CefJsDialogCallbackAdapter.cs

24 lines
605 B
C#

using CefSharp;
using TweetLib.Browser.CEF.Interfaces;
namespace TweetImpl.CefSharp.Adapters {
sealed class CefJsDialogCallbackAdapter : IJsDialogCallbackAdapter<IJsDialogCallback> {
public static CefJsDialogCallbackAdapter Instance { get; } = new ();
private CefJsDialogCallbackAdapter() {}
public void Continue(IJsDialogCallback callback, bool success, string? userInput = null) {
if (userInput == null) {
callback.Continue(success);
}
else {
callback.Continue(success, userInput);
}
}
public void Dispose(IJsDialogCallback callback) {
callback.Dispose();
}
}
}