App.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace RevokeMsgPatcher.Model
  7. {
  8. public class App
  9. {
  10. public string Name { get; set; }
  11. public Dictionary<string, TargetInfo> FileTargetInfos { get; set; }
  12. public Dictionary<string, List<ModifyInfo>> FileModifyInfos { get; set; }
  13. public HashSet<string> GetSupportVersions()
  14. {
  15. // 使用 HashSet 防重
  16. HashSet<string> versions = new HashSet<string>();
  17. foreach (List<ModifyInfo> modifyInfos in FileModifyInfos.Values)
  18. {
  19. foreach (ModifyInfo modifyInfo in modifyInfos)
  20. {
  21. versions.Add(modifyInfo.Version);
  22. }
  23. }
  24. return versions;
  25. }
  26. public string GetSupportVersionStr()
  27. {
  28. string str = "";
  29. foreach (string v in GetSupportVersions())
  30. {
  31. str += v + "、";
  32. }
  33. if (str.Length > 1)
  34. {
  35. str = str.Substring(0, str.Length - 1);
  36. }
  37. return str;
  38. }
  39. }
  40. }