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;
        }
        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, null);

                    webPart.PhotoId         = Videos.SelectedValue;
                    webPart.PhotoToken      = photo.Token;
                    webPart.TokenFreeEmbeds = TokenFreeCheck.Checked;
                }
            }

            return(true);
        }
 public ActionResult <List <Photo> > GetBis() =>
 _photoService.Get();
 public async Task <IList <Photo> > Get()
 {
     return(await photoService.Get());
 }
        public static Photo GetVideo(int videoId)
        {
            IPhotoService photoService = new PhotoService(Client.ApiProvider);

            return(photoService.Get(videoId, true));
        }
示例#6
0
        public ActionResult Details(int id)
        {
            var photo = _photoService.Get(id);

            return(photo != null ? (ActionResult)View(photo) : HttpNotFound());
        }