ScriptDialogEventArgs.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. using System;
  17. namespace Vuplex.WebView {
  18. /// <summary>
  19. /// Event args for `ScriptAlerted`. The `Continue` callback must
  20. /// be called to continue script execution.
  21. /// <summary>
  22. public class ScriptDialogEventArgs : EventArgs {
  23. public ScriptDialogEventArgs(string message, Action continueCallback) {
  24. Message = message;
  25. Continue = continueCallback;
  26. }
  27. /// <summary>
  28. /// The event's message.
  29. /// </summary>
  30. public readonly string Message;
  31. /// <summary>
  32. /// The callback to invoke to continue script execution.
  33. /// </summary>
  34. public readonly Action Continue;
  35. }
  36. /// <summary>
  37. /// Generic event args for script dialog events like
  38. /// `ScriptConfirmRequested`. The type parameter
  39. /// determines the data type that must be passed
  40. /// to the `Continue` callback to continue script execution.
  41. /// <summary>
  42. public class ScriptDialogEventArgs<T> : EventArgs {
  43. public ScriptDialogEventArgs(string message, Action<T> continueCallback) {
  44. Message = message;
  45. Continue = continueCallback;
  46. }
  47. /// <summary>
  48. /// The event's message.
  49. /// </summary>
  50. public readonly string Message;
  51. /// <summary>
  52. /// The callback to invoke to continue script execution.
  53. /// </summary>
  54. public readonly Action<T> Continue;
  55. }
  56. }