Exemplo n.º 1
0
 public void addContactToPanel(string username, string name, string contactUsername)
 {
     chats.Add(new chatbox2(username, contactUsername, this));
     contactss.Add(new contact("  " + name, contactUsername, chats[chats.Count - 1], this));
     contactUsernames.Add(contactUsername);
     friendP.add(contactss[contactss.Count - 1]);
 }
Exemplo n.º 2
0
        public screen(string userData)
        {
            InitializeComponent();
            this.userData = userData;
            myUsername    = Parse(userData, "Username");
            friendP       = new friendPanel(myUsername, this);
            panel1.Controls.Add(friendP);

            for (int contactNumber = 5; contactNumber > 0; contactNumber--)
            {
                string newcontact = Parse(userData, "Friend" + contactNumber);
                if (newcontact != "")
                {
                    contactUsernames.Add(newcontact);
                }
            }

            friendP.setList(contactUsernames);

            foreach (string contactUser in contactUsernames)
            {
                chats.Add(new chatbox2(myUsername, contactUser, this));
                string contactData = getDataFromUser(contactUser);
                contactss.Add(new contact("  " + Parse(contactData, "FirstName") + " " + Parse(contactData, "LastName"), contactUser, chats[chats.Count - 1], this));
                friendP.add(contactss[contactss.Count - 1]);
            }
            friendP.NoFriends();
        }