FocusedInputFieldChangedEventArgs.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 `FocusedInputFieldChangedEvent`.
  20. /// </summary>
  21. public class FocusedInputFieldChangedEventArgs : EventArgs {
  22. public FocusedInputFieldChangedEventArgs(FocusedInputFieldType type) {
  23. Type = type;
  24. }
  25. /// <summary>
  26. /// The type of input field focused.
  27. /// </summary>
  28. public readonly FocusedInputFieldType Type;
  29. public static FocusedInputFieldType ParseType(string typeString) {
  30. switch (typeString) {
  31. case "TEXT":
  32. return FocusedInputFieldType.Text;
  33. case "NONE":
  34. return FocusedInputFieldType.None;
  35. default:
  36. WebViewLogger.LogWarning("Unrecognized FocusedInputFieldType string: " + typeString);
  37. return FocusedInputFieldType.None;
  38. }
  39. }
  40. }
  41. }