Example #1
0
        public void SetCurrentSlide(int slideNumber)
        {
            if (slideNumber >= this.Slideshow.Slides.Count ||
                slideNumber < 0)
            {
                return;
            }
            CurrentIndex = slideNumber;
            ISlideSection currentSlide  = this.Slideshow.Slides[this.CurrentIndex];
            ISlideSection currentFooter = this.Slideshow.GetFooter(this.CurrentIndex);

            UpdateSlide?.Invoke(currentSlide, CurrentIndex);
            UpdateFooter?.Invoke(currentFooter, CurrentIndex);
        }
Example #2
0
        public IHttpActionResult Update([FromUri] Guid footer_id, [FromBody] UpdateFooter footer)
        {
            if (IsTokenValid() && authenticationService.IsAllowedToUpdateFooters(GetTokenUserEmail(), footer_id))
            {
                try
                {
                    footerManagementService.Update(footer_id, UpdateFooter.ToEntity(footer));
                    documentLogger.LogModificationToFooter(footer_id);

                    return(Ok(footer_id));
                }
                catch (MissingFooterException e)
                {
                    return(BadRequest(e.Message));
                }
                catch (Exceptions e)
                {
                    return(BadRequest(e.Message));
                }
            }

            return(Unauthorized());
        }