CefAuthCallback.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 authentication
  10. /// requests.
  11. /// </summary>
  12. public sealed unsafe partial class CefAuthCallback
  13. {
  14. /// <summary>
  15. /// Continue the authentication request.
  16. /// </summary>
  17. public void Continue(string username, string password)
  18. {
  19. fixed (char* username_str = username)
  20. fixed (char* password_str = password)
  21. {
  22. var n_username = new cef_string_t(username_str, username != null ? username.Length : 0);
  23. var n_password = new cef_string_t(password_str, password != null ? password.Length : 0);
  24. cef_auth_callback_t.cont(_self, &n_username, &n_password);
  25. }
  26. }
  27. /// <summary>
  28. /// Cancel the authentication request.
  29. /// </summary>
  30. public void Cancel()
  31. {
  32. cef_auth_callback_t.cancel(_self);
  33. }
  34. }
  35. }