private void TriggerChange(WidgetBase widget) { if (IsNeedNotifyChange) { if (widget != null && widget.PageID.IsNotNullAndWhiteSpace()) { using (var pageService = _serviceProvider.GetService <IPageService>()) { pageService.MarkChanged(widget.PageID); } } else if (widget != null && widget.LayoutID.IsNotNullAndWhiteSpace()) { using (var layoutService = _serviceProvider.GetService <ILayoutService>()) { layoutService.MarkChanged(widget.LayoutID); ClearCache(); } } } }
private void TriggerChange(WidgetBase widget) { if (IsNeedNotifyChange) { if (widget != null && widget.PageID.IsNotNullAndWhiteSpace()) { using (var pageService = _serviceProvider.GetService <IPageService>()) { pageService.MarkChanged(widget.PageID); } } else if (widget != null && widget.LayoutID.IsNotNullAndWhiteSpace()) { using (var layoutService = _serviceProvider.GetService <ILayoutService>()) { layoutService.MarkChanged(widget.LayoutID); } _pageWidgetCacheManage.ClearRegion(_httpContextAccessor.HttpContext.Request.Host.Value); } } }
public override void OnActionExecuted(ActionExecutedContext filterContext) { ViewResult result = filterContext.Result as ViewResult; if (result != null) { if (result.Model is WidgetBase) { WidgetBase widget = result.Model as WidgetBase; var zoneService = filterContext.HttpContext.RequestServices.GetService <IZoneService>(); if (!widget.PageID.IsNullOrEmpty()) { (filterContext.Controller as Controller).ViewData[ViewDataKeys.Zones] = new SelectList(zoneService.GetZonesByPageId(widget.PageID), "ID", "ZoneName"); } else if (!widget.LayoutID.IsNullOrEmpty()) { (filterContext.Controller as Controller).ViewData[ViewDataKeys.Zones] = new SelectList(zoneService.GetZonesByLayoutId(widget.LayoutID), "ID", "ZoneName"); } } } }
public virtual void Publish(WidgetBase widget) { widget.IsTemplate = false; widget.IsSystem = false; Add((T)widget); }
public virtual void UpdateWidget(WidgetBase widget) { Update((T)widget); }
public virtual void AddWidget(WidgetBase widget) { Add((T)widget); }
public virtual WidgetViewModelPart Display(WidgetBase widget, ActionContext actionContext) { return(widget.ToWidgetViewModelPart()); }
public override WidgetBase GetWidget(WidgetBase widget) { return(widget.CopyTo(JsonConvert.DeserializeObject <T>(widget.ExtendData ?? "{}")) as T); }
public virtual void Publish(WidgetBase widget) { AddWidget(widget); }