Exemplo n.º 1
0
        public void AddNewIndividualP2PChat(string sender, NetworkStream netStream, string key, bool display)
        {
            bool found = false;

            foreach (IndividualChatDriver icd in individualChatDrivers)
            {
                if (icd.getSender() == sender)
                {
                    found = true;
                    if (!icd.isWindowVisible())
                    {
                        icd.displayWindow();
                        icd.SetNormalWindowState();
                    }
                    icd.SwitchToP2P(netStream, key, messageHandler);
                }
            }
            if (found == false)
            {
                IndividualChatDriver icd = new IndividualChatDriver(username, sender, fileManager, netStream, messageHandler, key, contactsHandler.GetContact(sender).status);
                if (display)
                {
                    icd.displayWindow();
                    icd.SetNormalWindowState();
                }
                individualChatDrivers.Add(icd);
            }
        }
Exemplo n.º 2
0
        public void AddNewIndividualChat(string sender)
        {
            bool found = false;

            foreach (IndividualChatDriver icd in individualChatDrivers)
            {
                if (icd.getSender() == sender)
                {
                    found = true;
                    if (!icd.isWindowVisible())
                    {
                        icd.displayWindow();
                        icd.SetNormalWindowState();
                    }
                }
            }
            if (found == false)
            {
                var newICD = new IndividualChatDriver(writer, username, sender, fileManager, contactsHandler.GetContact(sender).status);
                newICD.displayWindow();
                newICD.SetNormalWindowState();
                individualChatDrivers.Add(newICD);
            }
        }