ScriptDialogEventArgs.cs 2.0 KB

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