public void Broadcast(Connection source, string message) { if (ShouldFilter(message)) { return; } var sourceInfo = source == null ? ChatSource.ServerSource : ChatSource.GetSourceFromConnection(source); for (int i = 0, l = connections.Count; i < l; i++) { connections[i].protocol.OnChatMessage(sourceInfo, message); } }
private void UpdateTableView() { Debug.WriteLine("DidEnterTableView"); if (ViewModel.Chat?.Messages?.Count > 0) { var source = new ChatSource(_tableView, ViewModel.Chat); _tableView.Source = source; _tableView.ReloadData(); source.ScrolledTopEvent -= OnSource_ScrollTopEvent; source.ScrolledTopEvent += OnSource_ScrollTopEvent; } }
private void AddChat(string coach, ChatSource source, string text) { string colour; switch (source) { case ChatSource.Home: colour = "#ff0000"; break; case ChatSource.Away: colour = "#0000ff"; break; default: colour = "#336633"; break; } string line = $"<<{colour}>{TextPanelHandler.SanitizeText(coach)}</color>> {TextPanelHandler.SanitizeText(text)}"; AddChatText(line); }
internal void AddChatEntry(string coach, string text) { ChatSource source = ChatSource.Spectator; if (string.Equals(FFB.Instance.Model.HomeCoach.Name, coach)) { source = ChatSource.Home; } if (string.Equals(FFB.Instance.Model.AwayCoach.Name, coach)) { source = ChatSource.Away; } ChatEntry entry = new ChatEntry(coach, source, text); ChatText.Add(entry); TriggerChatChanged(entry); }
private void AddChat(string coach, ChatSource source, string text) { if (this.panelType == FFB.LogPanelType.Chat) { string colour; switch (source) { case ChatSource.Home: colour = "#ff0000"; break; case ChatSource.Away: colour = "#0000ff"; break; default: colour = "#336633"; break; } string line = $"<<{colour}>{TextPanelHandler.SanitizeText(coach)}</color>> {TextPanelHandler.SanitizeText(text)}"; AddText(line, 0); OnScroll(Vector2.zero); } }
private void CloseChat_Click(object sender, RoutedEventArgs e) { ChatSource cs = (sender as MenuItem).Tag as ChatSource; _chat.CloseChat(cs); }
public ChatEntry(string coach, ChatSource source, string text) { Coach = coach; Source = source; Text = text; }