Esempio n. 1
0
 void Chatting_eChatEvent(ChatRoom cr, Chatting.ChatEvent e, User u, object data)
 {
     if (e != Chatting.ChatEvent.ChatMessage)
     {
         RefreshList();
     }
 }
Esempio n. 2
0
        void Chatting_eChatEvent(ChatRoom cr, Chatting.ChatEvent e, User user,object data)
        {
            Dispatcher.Invoke(new Action(() =>
            {

                    ChatWindow cw = Program.ChatWindows.FirstOrDefault(cww => cww.ID == cr.ID);
                    if (cw == null)
                    {
                        ChatWindow c = new ChatWindow(cr.ID);
                        c.Loaded += delegate
                        {
                            c.ChatEvent(cr, e, user, data);
                        };
                        Program.ChatWindows.Add(c);
                        if(cr.ID != 0)
                            c.Show();
                    }
                    else
                    {
                        if (cw.ID != 0)
                        {
                            cw.Show();
                        }
                    }
            }));
        }
Esempio n. 3
0
 public void ChatEvent(ChatRoom cr, Chatting.ChatEvent e, User user, object data)
 {
     Chatting_eChatEvent(cr,  e,user,data);
 }
Esempio n. 4
0
        void Chatting_eChatEvent(ChatRoom cr, Chatting.ChatEvent e, User user, object data)
        {
            if (cr.ID == ID)
            {
                Dispatcher.Invoke(new Action(() =>
                {
                    switch (e)
                    {
                        case Chatting.ChatEvent.ChatMessage:
                            {
                                Brush b = Brushes.Black;
                                if (user.Uid == Program.lobbyClient.Me.Uid)
                                    b = Brushes.Blue;

                                Run r = getUserRun(user.DisplayName, "[" + user.DisplayName + "] : ");
                                r.Foreground = b;
                                String mess = data as string;
                                AddChatText(r, mess);
                                break;
                            }
                        case Chatting.ChatEvent.MeJoinedChat:
                            {
                                ResetUserList();
                                break;
                            }
                        case Chatting.ChatEvent.UserJoinedChat:
                            {
                                string reg = Registry.ReadValue("Options_HideLoginNotifications");
                                if (reg == "false" || reg == null)
                                {
                                    Run r = new Run("#" + user.DisplayName + ": ");
                                    Brush b = Brushes.DarkGray;
                                    r.ToolTip = DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToLongDateString();
                                    r.Foreground = b;
                                    AddChatText(r, "Joined the chat.", b);
                                    ResetUserList();
                                }
                                break;
                            }
                        case Chatting.ChatEvent.UserLeftChat:
                            {
                                string reg = Registry.ReadValue("Options_HideLoginNotifications");
                                if (reg == "false" || reg == null)
                                {
                                    Run r = new Run("#" + user.DisplayName + ": ");
                                    Brush b = Brushes.LightGray;
                                    r.ToolTip = DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToLongDateString();
                                    r.Foreground = b;
                                    AddChatText(r, "Left the chat.", b);
                                    ResetUserList();
                                }
                                    break;
                            }
                    }
                }));
            }
        }