void updateEmuInfo() { EmulatorInfo lEmuInfo = new EmulatorScraperHandler().UpdateEmuInfo(platformComboBox.Text, (o) => { EmulatorInfo emuInfo = (EmulatorInfo)o; if (logo != null) { logo.Dispose(); logo = null; } if (fanart != null) { fanart.Dispose(); fanart = null; } logo = ImageHandler.BitmapFromWeb(emuInfo.LogoUrl); fanart = ImageHandler.BitmapFromWeb(emuInfo.FanartUrl); return(true); }); if (lEmuInfo != null) { txt_Title.Text = lEmuInfo.Title; txt_company.Text = lEmuInfo.Developer; txt_description.Text = lEmuInfo.GetDescription(); int grade; if (int.TryParse(lEmuInfo.Grade, out grade)) { gradeUpDown.Value = grade; } return; } }
void loadImage() { try { //attempt to load specified file if (path.ToLower().StartsWith("http://")) { using (Image newImage = ImageHandler.BitmapFromWeb(path)) { //set thumb to new image image = ImageHandler.NewImage(newImage); } } else { using (Image newImage = Image.FromFile(path)) { //set thumb to new image image = ImageHandler.NewImage(newImage); } } } catch (Exception ex) { //reset fields on error Logger.LogError("ThumbGroup - Error loading {0} - {1}", friendlyName, ex.Message); clearThumb(); } }