private void retrieveButton_Click(object sender, EventArgs e)
{
// make sure we have a username
if (retrieveButton.Text.Length == 0)
return;
string userName = userNameTextBox.Text;
// init class and retrieve info
try
{
coderWallData = new CoderwallAPI(userName);
}
catch (coderwall_api.NotFoundException Ex)
{
MessageBox.Show(Ex.Message);
return;
}
nameValueLabel.Text = coderWallData.Name;
locationValueLabel.Text = coderWallData.Location;
endorsementsValueLabel.Text = coderWallData.Endorsements.ToString();
// show badges
for (int c = 0; c < coderWallData.BadgeCount; c++)
{
ListViewItem i = listView1.Items.Add(coderWallData.Badges[c].name);
i.ToolTipText = coderWallData.Badges[c].description;
}
}