protected override void BackButtonWasPressed(ViewController topViewController) { if (topViewController is SongDetail) { DismissViewController(topViewController); } else if (!_songDetail.GetField <bool>("_isInTransition")) { if (!tournamentMode) { if (isHost) { Plugin.client?.DeleteMatch(Match); } else { Match.Players = Match.Players.ToList().Except(new Player[] { Plugin.client.Self as Player }).ToArray(); Plugin.client?.UpdateMatch(Match); Dismiss(); } } else { Dismiss(); } } }
protected override void BackButtonWasPressed(ViewController topViewController) { if (topViewController is SongDetail) { DismissViewController(topViewController); } else if (!_songDetail.GetField <bool>("_isInTransition")) { if (!TournamentMode) { if (isHost) { Plugin.client?.DeleteMatch(Match); } else { var toAdd = Match.Players.ToList().Where(p => p.Id != (Plugin.client.SelfObject as Player).Id); Match.Players.Clear(); Match.Players.AddRange(toAdd); Plugin.client?.UpdateMatch(Match); Dismiss(); } } else { Dismiss(); } } }