Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
    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);
        }
    }
Exemplo n.º 6
0
        private void CloseChat_Click(object sender, RoutedEventArgs e)
        {
            ChatSource cs = (sender as MenuItem).Tag as ChatSource;

            _chat.CloseChat(cs);
        }
Exemplo n.º 7
0
 public ChatEntry(string coach, ChatSource source, string text)
 {
     Coach  = coach;
     Source = source;
     Text   = text;
 }