public void SyncMessageChannel() { Messager messager = ((MessageChannelListView)m_ScrollListView).Messager; if (!messager) { return; } if (IsPlayerNumbersAsync()) { messager.UpdateChannel(m_AsyncItem.ChannelId, m_AsyncItem.PlayerNumbers.ToArray()); } if (IsChannelNameAsync()) { messager.UpdateChannel(m_AsyncItem.ChannelId, m_AsyncItem.ChannelName); } //强制执行Messager频道更新 messager.UpdateChannels(); }
public void UpdateLocalPlayerNumbers(string numbersText) { Regex regex = new Regex(PLAYER_NUMBERS_REGEX); Match match = regex.Match(numbersText); HashSet <int> playerNumbers = new HashSet <int>(); Messager messager = ((MessageChannelListView)m_ScrollListView).Messager; while (match.Success) { int number; if (int.TryParse(match.Groups[1].Value, out number)) { if (messager.ValidatePlayerNumber(number)) { playerNumbers.Add(number); } } match = match.NextMatch(); } m_AsyncItem.PlayerNumbers = playerNumbers; DisplayPlayerNumbers(m_AsyncItem.PlayerNumbers); onIsAsync.Invoke(IsAsync()); }