Beispiel #1
0
        private void CheckNewMessages()
        {
            messages_tmp.AddRange(MessApi.Message_GetMyNewMessages(id_usr, password));

            if (messages_tmp != null && messages_tmp.Count > 0)
            {
                FillMessagesToWins();

                if (messages_tmp.Count > 0)
                {
                    foreach (var item in messages_tmp)
                    {
                        ImUser imu = MessApi.Contact_GetAllContacts().Where(i => i.ID_USR.Equals(item.ID_SENDER)).FirstOrDefault();
                        if (imu != null)
                        {
                            ChatWindow chw = new ChatWindow(id_usr, item.ID_SENDER, password, imu.USR_NICK);
                            openedWins.Add(chw);
                            chw.FormClosed += new FormClosedEventHandler(chw_FormClosed);
                            chw.Show();
                        }
                    }
                    FillMessagesToWins();
                }
            }
        }
Beispiel #2
0
        void listBox1_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            ImUser imuser = (ImUser)listboxContacts.listBox1.SelectedItem;
            bool isIn = false;
            foreach (var item in openedWins)
            {
                isIn = (item.comm_usr == imuser.ID_USR);
                item.Focus();
            }

            if (!isIn)
            {
                ChatWindow chw = new ChatWindow(id_usr, imuser.ID_USR, password, imuser.USR_NICK);
                openedWins.Add(chw);
                chw.FormClosed += new FormClosedEventHandler(chw_FormClosed);
                chw.Show();
            }
        }