private void AddSpectatorEntry(int spectatorId, string spectatorName) { ExecuteOnUIThread.Invoke(() => SpectatorList.Add(new SpectatorData { SpectatorId = spectatorId, SpectatorName = spectatorName, })); }
private void ClearEntries() { ExecuteOnUIThread.Invoke(() => { PlayerList.Clear(); SpectatorList.Clear(); }); }
private void DeleteSpectatorEntry(int spectatorId, string spectatorName) { ExecuteOnUIThread.Invoke(() => { SpectatorData s = SpectatorList.FirstOrDefault(x => x.SpectatorId == spectatorId); if (s != null) { SpectatorList.Remove(s); } else { Log.Default.WriteLine(LogLevels.Warning, "Trying to delete unknown spectator {0}[{1}] from spectator list", spectatorId, spectatorName); } }); }