Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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);
        }