private void ics_LoginResponse(object sender, System.Boolean loginSuccess, System.String messageFromServer)
{
Invoke(new MethodInvoker(delegate
{
if (loginSuccess)
{
lblLoginStatus.Text = "Logged in..";
pbLoginStatus.Image = Properties.Resources.Online;
pbProfile.Image = ics.GetProfilePicture(txtUserName.Text);
//get the list of contacts
ics.GetContactList();
this.ics.GetPendingContactRequests();
}
else
{
pbProfile.Image = null;
btnLogin.Enabled = true;
btnLogout.Enabled = false;
this.lblLoginStatus.Text = "Not logged in..";
this.pbLoginStatus.Image = CentralServerDemo.Properties.Resources.Offline;
this.lvContact.Items.Clear();
MessageBox.Show(messageFromServer, "Unable to login", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
));
}