private void HandleImageDownloadComplete(object sender, ImageDownloadCompleteEventArgs idcea) { // If the image download was successful, set the profile image if (idcea.Successful) { //status.ProfileImageFile = idcea.TargetImageFile; profileImageDownloaded = true; PictureBoxImage = idcea.TargetImageFile; // Check the parent control to find other StatusBoxes with the same user ID for(int i = 0; i < this.Parent.Controls.Count; i++) { StatusBox sbox = this.Parent.Controls[i] as StatusBox; if (sbox != null && sbox != this && sbox.Status.ProfileImageFile == this.Status.ProfileImageFile) { sbox.PictureBoxImage = idcea.TargetImageFile; } } } }
protected virtual void OnImageDownloadComplete(ImageDownloadCompleteEventArgs idcea) { if (ImageDownloadComplete != null) { ImageDownloadComplete(this, idcea); } }