CentralServerDemo.MainForm.ics_LoginResponse C# (CSharp) Method

ics_LoginResponse() private method

Login response event handler
private ics_LoginResponse ( object sender, System loginSuccess, System messageFromServer ) : void
sender object
loginSuccess System
messageFromServer System
return void
		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);
				}
			}
			));

		}
MainForm