SlotBorderConverter.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using OpenSEMI.Ctrlib.Controls;
  2. using System;
  3. using System.Windows.Data;
  4. namespace MECF.Framework.UI.Core.DxfScript.Converter
  5. {
  6. class SlotBorderConverter : IValueConverter
  7. {
  8. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  9. {
  10. if (value is SlotBorderStatus)
  11. {
  12. //deal with the priority
  13. SlotBorderStatus status = (SlotBorderStatus)value;
  14. if (status.HasFlag(SlotBorderStatus.MouseOver))
  15. return SlotBorderStatus.MouseOver;
  16. else if (status.HasFlag(SlotBorderStatus.TransferSource))
  17. return SlotBorderStatus.TransferSource;
  18. else if (status.HasFlag(SlotBorderStatus.TransferTarget))
  19. return SlotBorderStatus.TransferTarget;
  20. else if (status.HasFlag(SlotBorderStatus.Selected))
  21. return SlotBorderStatus.Selected;
  22. else
  23. return SlotBorderStatus.None;
  24. }
  25. return SlotBorderStatus.None;
  26. }
  27. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  28. {
  29. throw new NotImplementedException();
  30. }
  31. }
  32. }