[#] 完善了补丁更新机制

This commit is contained in:
huiyadanli
2019-10-06 13:19:15 +08:00
parent b1b339ac63
commit 8ae2607d7b
9 changed files with 117 additions and 213 deletions
+28
View File
@@ -13,5 +13,33 @@ namespace RevokeMsgPatcher.Model
public Dictionary<string, TargetInfo> FileTargetInfos { get; set; }
public Dictionary<string, List<ModifyInfo>> FileModifyInfos { get; set; }
public HashSet<string> GetSupportVersions()
{
// 使用 HashSet 防重
HashSet<string> versions = new HashSet<string>();
foreach (List<ModifyInfo> modifyInfos in FileModifyInfos.Values)
{
foreach (ModifyInfo modifyInfo in modifyInfos)
{
versions.Add(modifyInfo.Version);
}
}
return versions;
}
public string GetSupportVersionStr()
{
string str = "";
foreach (string v in GetSupportVersions())
{
str += v + "、";
}
if (str.Length > 1)
{
str = str.Substring(0, str.Length - 1);
}
return str;
}
}
}