IoConverter.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Windows.Data;
  7. using System.Windows.Media;
  8. using Aitex.Sorter.Common;
  9. namespace Aitex.Sorter.UI.Converter
  10. {
  11. public class DiIndexDisplayConvert : IValueConverter
  12. {
  13. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  14. {
  15. return string.Format("DI-{0}", value ==null ? "":value.ToString());
  16. }
  17. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  18. {
  19. throw new NotImplementedException();
  20. }
  21. }
  22. public class DoIndexDisplayConvert : IValueConverter
  23. {
  24. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  25. {
  26. return string.Format("DO-{0}", value ==null ? "":value.ToString());
  27. }
  28. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. }
  33. public class DiValueBackgroundConvert : IValueConverter
  34. {
  35. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  36. {
  37. return (bool)value ? "LightGreen":"LightGray";
  38. }
  39. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  40. {
  41. throw new NotImplementedException();
  42. }
  43. }
  44. public class AiIndexDisplayConvert : IValueConverter
  45. {
  46. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  47. {
  48. return string.Format("AI-{0}", value == null ? "" : value.ToString());
  49. }
  50. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  51. {
  52. throw new NotImplementedException();
  53. }
  54. }
  55. public class AoIndexDisplayConvert : IValueConverter
  56. {
  57. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  58. {
  59. return string.Format("AO-{0}", value == null ? "" : value.ToString());
  60. }
  61. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  62. {
  63. throw new NotImplementedException();
  64. }
  65. }
  66. }