CefFileDialogCallback.cs 1.3 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 for asynchronous continuation of file dialog requests.
  10. /// </summary>
  11. public sealed unsafe partial class CefFileDialogCallback
  12. {
  13. /// <summary>
  14. /// Continue the file selection. |selected_accept_filter| should be the 0-based
  15. /// index of the value selected from the accept filters array passed to
  16. /// CefDialogHandler::OnFileDialog. |file_paths| should be a single value or a
  17. /// list of values depending on the dialog mode. An empty |file_paths| value is
  18. /// treated the same as calling Cancel().
  19. /// </summary>
  20. public void Continue(int selectedAcceptFilter, string[] filePaths)
  21. {
  22. var n_filePaths = cef_string_list.From(filePaths);
  23. cef_file_dialog_callback_t.cont(_self, selectedAcceptFilter, n_filePaths);
  24. libcef.string_list_free(n_filePaths);
  25. }
  26. /// <summary>
  27. /// Cancel the file selection.
  28. /// </summary>
  29. public void Cancel()
  30. {
  31. cef_file_dialog_callback_t.cancel(_self);
  32. }
  33. }
  34. }