CommonConverter.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Data;
  7. namespace VirgoUI.Client.Models.Converter
  8. {
  9. public class FOUPStatusConverter : IValueConverter
  10. {
  11. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. if (value == null)
  14. return string.Empty;
  15. string result = string.Empty;
  16. int iValue;
  17. if (int.TryParse(value.ToString(), out iValue))
  18. {
  19. if (iValue == 0)
  20. result = "Loaded";
  21. else if (iValue == 1)
  22. result = "Mapped";
  23. }
  24. return result;
  25. }
  26. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. }
  31. public class FOUPNameConverter : IValueConverter
  32. {
  33. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  34. {
  35. if (value == null)
  36. return string.Empty;
  37. if(value.ToString() == "Buffer")
  38. {
  39. return "Cooling";
  40. }
  41. return value.ToString();
  42. }
  43. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  44. {
  45. throw new NotImplementedException();
  46. }
  47. }
  48. }