示例#1
0
 private void AddSpectatorEntry(int spectatorId, string spectatorName)
 {
     ExecuteOnUIThread.Invoke(() => SpectatorList.Add(new SpectatorData
     {
         SpectatorId   = spectatorId,
         SpectatorName = spectatorName,
     }));
 }
示例#2
0
 private void ClearEntries()
 {
     ExecuteOnUIThread.Invoke(() =>
     {
         PlayerList.Clear();
         SpectatorList.Clear();
     });
 }
示例#3
0
 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);
         }
     });
 }