protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); JavaScriptSerializer js = new JavaScriptSerializer(); List <TourItem> items = null; if (string.IsNullOrEmpty(TourSettingsId)) { items = new List <TourItem>(); } else { try { TourSettings settings = (TourSettings)Parent.FindControl(TourSettingsId); items = settings.Items; foreach (var item in items) { if (item.SourceType == TourItem.SourceTypeOption.HelpFile) { setContentFromFile(item); } } } catch (Exception ex) { log.Error("Error getting tour settings", ex); items = new List <TourItem>(); } } ItemsHiddenField.Value = js.Serialize(items); try { bool wasViewed = TourBLL.CheckIfUserViewTour(UserId, TourId); if (!wasViewed) { ShowTourHiddenField.Value = "true"; } else { ShowTourHiddenField.Value = "false"; } } catch (Exception ex) { log.Error("Error checking tour visibility", ex); } }
public TourController( TourFilterCollection filters, IHostingEnvironment hostingEnvironment, IOptionsSnapshot <TourSettings> tourSettings, IBackOfficeSecurityAccessor backofficeSecurityAccessor, IContentTypeService contentTypeService) { _filters = filters; _hostingEnvironment = hostingEnvironment; _tourSettings = tourSettings.Value; _backofficeSecurityAccessor = backofficeSecurityAccessor; _contentTypeService = contentTypeService; }