/// <summary> /// Displays the infographic. /// </summary> /// <param name="id">Infographic Id.</param> /// <returns>Infographic.</returns> public ActionResult Display(int?id) { CefRequest cef = null; ActionResult ret = null; VoiceOverRequest vo = null; Models.PresentationDisplayModel model = null; if (id == null || !id.HasValue) { ret = HttpNotFound(); } else { cef = CefRequest.ReadFrom(HttpContext.Request); vo = VoiceOverRequest.ReadFrom(HttpContext.Request); model = GetModel(id.Value, cef, vo); if (model != null) { if (Request.AcceptTypes == null || !Request.AcceptTypes.Any() || Request.AcceptTypes.Any(t => t.IndexOf("html", System.StringComparison.OrdinalIgnoreCase) >= 0) || IsScraper(Request)) { ret = View(model); } else if ((model.Presentation == null && model.RequiresPassword) || (model.Presentation != null && model.Presentation.Id != DemoPresentationId)) { ret = View("DisplayEmbedded", model); } } if (ret == null) { ret = HttpNotFound(); } else if (cef == null && vo == null) { RecordImpression(model); } } return(ret); }