private void addVersionBtn_Click(object sender, EventArgs e) { if (modifierConfig.Versions == null) { modifierConfig.Versions = new List <Version>(); } //先寻找有没有MD5相同的 var version = UpdateVersionBox.UpdateVersion(); if (version != null) { foreach (var ver in modifierConfig.Versions) { if (ver.FileMd5 == version.FileMd5) { MessageBox.Show("新增的版本MD5与已存在的版本有重叠,拒绝添加!"); return; } } //新建版本的时候拷贝页面 if (modifierConfig.Versions.Count > 0) { //待做 } modifierConfig.Versions.Add(version); LoadVersions(); } }
private void updateVersionBtn_Click(object sender, EventArgs e) { int index = GetVersionIndex(); if (index >= 0) { var currentVersion = modifierConfig.Versions[index]; if (currentVersion != null) { UpdateVersionBox.UpdateVersion(currentVersion); LoadVersions(); } else { MessageBox.Show("选取版本失败"); } } LoadVersions(); }