public async Task Update(int SelectedIndex) { Gamemode Gamemode = DisplayGamemodes[SelectedIndex]; int CallerIndex = MainWindow?.Gamemodes.IndexOf(Gamemode) ?? -1; Release Release = GamemodeReleases[Gamemode]; ReleaseAsset FoundAsset = null; foreach (ReleaseAsset Asset in Release.Assets.Where(Asset => Asset.Name.EndsWith(".dll"))) { FoundAsset = Asset; } if (FoundAsset == null) { return; } if (!await Update(MainWindow.GetCurrentLazerPath(), Gamemode, FoundAsset)) { return; } GamemodeReleases.Remove(Gamemode); DisplayGamemodes.RemoveAt(SelectedIndex); Title = OriginalTitle.Replace("%%COUNT%%", GamemodeReleases.Count.ToString("N0")).Replace("%%S%%", GamemodeReleases.Count != 1 ? "s" : string.Empty); if (CallerIndex >= 0) { Gamemode GamemodeClone = (Gamemode)Gamemode.Clone(); GamemodeClone.UpdateStatus = UpdateStatus.UpToDate; GamemodeClone.GitHubTagVersion = Release.TagName ?? GamemodeClone.GitHubTagVersion; MainWindow.UpdateGamemode(CallerIndex, GamemodeClone, true); } }