mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-22 03:37:25 +08:00
Overloading ContentPart to optionally have new shape passed in
If lambda takes an argument, it is dynamic, and is an uninitialized shape of the named type ShapeHelper and IShapeHelperFactory are obsolete - IShapeFactory itself is now dynamic --HG-- branch : dev
This commit is contained in:
@@ -26,8 +26,7 @@ namespace Orchard.Themes.Controllers {
|
||||
IThemeService themeService,
|
||||
IPreviewTheme previewTheme,
|
||||
IAuthorizer authorizer,
|
||||
INotifier notifier,
|
||||
IShapeHelperFactory shapeHelperFactory) {
|
||||
INotifier notifier) {
|
||||
Services = services;
|
||||
_dataMigrationManager = dataMigraitonManager;
|
||||
_reportsCoordinator = reportsCoordinator;
|
||||
@@ -36,7 +35,6 @@ namespace Orchard.Themes.Controllers {
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
dynamic Shape { get; set; }
|
||||
public IOrchardServices Services{ get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
|
@@ -9,13 +9,17 @@ namespace Orchard.Themes.Preview {
|
||||
private readonly IThemeService _themeService;
|
||||
private readonly IPreviewTheme _previewTheme;
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IShapeHelperFactory _shapeHelperFactory;
|
||||
private readonly dynamic _shapeFactory;
|
||||
|
||||
public PreviewThemeFilter(IThemeService themeService, IPreviewTheme previewTheme, IWorkContextAccessor workContextAccessor, IShapeHelperFactory shapeHelperFactory) {
|
||||
public PreviewThemeFilter(
|
||||
IThemeService themeService,
|
||||
IPreviewTheme previewTheme,
|
||||
IWorkContextAccessor workContextAccessor,
|
||||
IShapeFactory shapeFactory) {
|
||||
_themeService = themeService;
|
||||
_previewTheme = previewTheme;
|
||||
_workContextAccessor = workContextAccessor;
|
||||
_shapeHelperFactory = shapeHelperFactory;
|
||||
_shapeFactory = shapeFactory;
|
||||
}
|
||||
|
||||
public void OnResultExecuting(ResultExecutingContext filterContext) {
|
||||
@@ -33,8 +37,8 @@ namespace Orchard.Themes.Preview {
|
||||
.ToList();
|
||||
|
||||
|
||||
var shape = _shapeHelperFactory.CreateHelper();
|
||||
_workContextAccessor.GetContext(filterContext).Layout.Zones["Body"].Add(shape.ThemePreview(Themes: themeListItems), ":before");
|
||||
|
||||
_workContextAccessor.GetContext(filterContext).Layout.Zones["Body"].Add(_shapeFactory.ThemePreview(Themes: themeListItems), ":before");
|
||||
}
|
||||
|
||||
public void OnResultExecuted(ResultExecutedContext filterContext) { }
|
||||
|
Reference in New Issue
Block a user