LinkedChild.cs 849 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections;
  3. namespace MediaBrowser.Controller.Entities
  4. {
  5. public class LinkedChild
  6. {
  7. public string Path { get; set; }
  8. public LinkedChildType Type { get; set; }
  9. }
  10. public enum LinkedChildType
  11. {
  12. Manual = 1,
  13. Shortcut = 2
  14. }
  15. public class LinkedChildComparer : IComparer
  16. {
  17. public int Compare(object x, object y)
  18. {
  19. var a = (LinkedChild)x;
  20. var b = (LinkedChild)y;
  21. if (!string.Equals(a.Path, b.Path, StringComparison.OrdinalIgnoreCase))
  22. {
  23. return string.Compare(a.Path, b.Path, StringComparison.OrdinalIgnoreCase);
  24. }
  25. if (a.Type != b.Type)
  26. {
  27. return a.Type.CompareTo(b.Type);
  28. }
  29. return 0;
  30. }
  31. }
  32. }