CefJSDialogCallback.cs 975 B

1234567891011121314151617181920212223242526272829
  1. namespace Xilium.CefGlue
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Runtime.InteropServices;
  7. using Xilium.CefGlue.Interop;
  8. /// <summary>
  9. /// Callback interface used for asynchronous continuation of JavaScript dialog
  10. /// requests.
  11. /// </summary>
  12. public sealed unsafe partial class CefJSDialogCallback
  13. {
  14. /// <summary>
  15. /// Continue the JS dialog request. Set |success| to true if the OK button was
  16. /// pressed. The |user_input| value should be specified for prompt dialogs.
  17. /// </summary>
  18. public void Continue(bool success, string userInput)
  19. {
  20. fixed (char* userInput_str = userInput)
  21. {
  22. var n_userInput = new cef_string_t(userInput_str, userInput != null ? userInput.Length : 0);
  23. cef_jsdialog_callback_t.cont(_self, success ? 1 : 0, &n_userInput);
  24. }
  25. }
  26. }
  27. }