private void button12_Click(object sender, EventArgs e) { messageSpecs.CreateGroupMessage x = new messageSpecs.CreateGroupMessage(); x.GroupName = "Test Group"; x.memberList.Add(2); x.memberList.Add(10006); x.memberList.Add(10007); clientSocket.Send(x.getMessageString()); }
private void buttonCreateGroup_Click(object sender, EventArgs e) { labelFriendListStatus.Text = string.Empty; if (string.IsNullOrEmpty(Validations.isGroupNameValid(textBoxGroupName.Text)) && listBoxGroupList.Items.Count > 0) { messageSpecs.CreateGroupMessage createGroupMessage = new messageSpecs.CreateGroupMessage(); createGroupMessage.GroupName = textBoxGroupName.Text; foreach (var item in listBoxGroupList.Items) { keyValuePair = (KeyValuePair<long, string>)item; createGroupMessage.memberList.Add(keyValuePair.Key); } createGroupMessage.memberList.Add(UserID); _myClient.Send(createGroupMessage.getMessageString()); this.Close(); } else { labelFriendListStatus.Text = string.IsNullOrEmpty(Validations.isGroupNameValid(textBoxGroupName.Text)) ? "Select friends to be added to the group" : listBoxGroupList.Items.Count > 0 ? "Enter Group Name" : "Enter Group Name and select friends to be added to the group"; labelFriendListStatus.Visible = true; } }
private void button10_Click(object sender, EventArgs e) { messageSpecs.CreateGroupMessage x = new messageSpecs.CreateGroupMessage(); x.memberList.Add("1"); x.memberList.Add("2"); messageSpecs.CreateGroupMessage y = new messageSpecs.CreateGroupMessage(x.getMessageString()); }