FocusedInputFieldChangedEventArgs.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. using Vuplex.WebView.Internal;
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// Event args for FocusedInputFieldChanged.
  19. /// </summary>
  20. public class FocusedInputFieldChangedEventArgs : EventArgs {
  21. public FocusedInputFieldChangedEventArgs(FocusedInputFieldType type) => Type = type;
  22. /// <summary>
  23. /// The type of input field focused.
  24. /// </summary>
  25. public readonly FocusedInputFieldType Type;
  26. public static FocusedInputFieldType ParseType(string typeString) {
  27. switch (typeString) {
  28. case "IFRAME":
  29. return FocusedInputFieldType.IFrame;
  30. case "NONE":
  31. return FocusedInputFieldType.None;
  32. case "TEXT":
  33. return FocusedInputFieldType.Text;
  34. default:
  35. WebViewLogger.LogWarning("Unrecognized FocusedInputFieldType string: " + typeString);
  36. return FocusedInputFieldType.None;
  37. }
  38. }
  39. }
  40. }