public void editItem(info editMovie) { this.index = DataManager.getIndexOf(editMovie); this.selected = DataManager.getMovie(index); titleT.Text = editMovie.getTitle(); fileLocationT.Text = editMovie.File; genreCB.SelectedIndex = (int)editMovie.Genre; ratingCB.SelectedIndex = (int)editMovie.Rating; movieData = DataManager.getdata(editMovie.File); yearT.Text = movieData.Year.ToString(); imageT.Text = movieData.Image; actors = movieData.getActors(); actorListBox.DataSource = actors; descriptionT.Text = movieData.Description.Replace("\n", "\r\n"); if (movieData.Image != "") { try { Image image = Image.FromFile(@movieData.Image); Rectangle newRect = ImageHandling.GetScaledRectangle(image, imageP.ClientRectangle); imageP.MaximumSize = imageP.Size; imageP.Image = ImageHandling.GetResizedImage(image, newRect); } catch (ArgumentException ae) { DataManager.GE.GlobalTryCatch(ae, movieData.Image); } catch (FileNotFoundException fnfe) { DataManager.GE.GlobalTryCatch(fnfe, movieData.Image); } } else { } }
public void viewItem(info view) { this.view = view; titleL.Text = view.getTitle(); fileL.Text = view.File; genreL.Text = view.Genre.ToString(); ratingL.Text = view.Rating.ToString(); if ((this.Data = dm.getdata(view.File)) != null) { yearL.Text = Data.Year.ToString(); imageL.Text = Data.Image; description.Text = Data.Description; actor = null; actor = Data.getActors(); actors.DataSource = null; actors.DataSource = actor; secondsIn.Text = String.Format("{0}{1}", "Time: ", Data.SecondsIn * 1000); string imageFile = Data.Image; if (imageFile == "") { imageFile = @"noImage.png"; } DoImage(imageFile, false); } else { yearL.Text = "No Year"; imageL.Text = "No Image"; description.Text = "No Description"; actor.Clear(); actor.Add("No Actors"); actors.DataSource = null; actors.DataSource = actor; } }