public override void SyncChanges() { // Make sure that all is set up EnsureChildControls(); // Update the editor VisualEmbed webPart = (VisualEmbed)WebPartToEdit; if (webPart != null) { if ((Videos != null) && (Videos.Items.FindByValue(webPart.PhotoId) != null)) { Videos.SelectedValue = webPart.PhotoId; } } return; }
public override bool ApplyChanges() { // Make sure that all is set up EnsureChildControls(); // Update the web part VisualEmbed webPart = (VisualEmbed)WebPartToEdit; if (webPart != null) { // Get the token for the photo first if (Videos != null) { IPhotoService photoService = new PhotoService(Utilities.ApiProvider); Domain.Photo photo = photoService.Get(Convert.ToInt32(Videos.SelectedValue), false); webPart.PhotoId = Videos.SelectedValue; webPart.PhotoToken = photo.Token; } } return(true); }