diff --git a/src/Orchard/Mvc/Html/LayoutExtensions.cs b/src/Orchard/Mvc/Html/LayoutExtensions.cs index 8b04462ee..87fc99438 100644 --- a/src/Orchard/Mvc/Html/LayoutExtensions.cs +++ b/src/Orchard/Mvc/Html/LayoutExtensions.cs @@ -86,9 +86,9 @@ namespace Orchard.Mvc.Html { manager.Render(html, html.ViewData.Model.Zones, null, null, except); } - public static void ZoneBody(this HtmlHelper html, string zoneName) where TModel : BaseViewModel { - html.Zone(zoneName, () => html.RenderBody()); - } + //public static void ZoneBody(this HtmlHelper html, string zoneName) where TModel : BaseViewModel { + // html.Zone(zoneName, () => html.RenderBody()); + //} public static void RegisterMeta(this HtmlHelper html, string name, string content) { html.Resolve().RegisterMeta(name, content); diff --git a/src/Orchard/Mvc/ViewModels/AdaptedViewModel.cs b/src/Orchard/Mvc/ViewModels/AdaptedViewModel.cs deleted file mode 100644 index 926709ee3..000000000 --- a/src/Orchard/Mvc/ViewModels/AdaptedViewModel.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using Orchard.Security; -using Orchard.UI.Navigation; -using Orchard.UI.Notify; -using Orchard.UI.Zones; - -namespace Orchard.Mvc.ViewModels { - class AdaptedViewModel : BaseViewModel { - private readonly Property _zones; - private readonly Property> _menu; - private readonly Property> _messages; - private readonly Property _currentUser; - - public AdaptedViewModel(ViewDataDictionary original) { - _zones = new Property(original, "Zones", () => new ZoneCollection()); - _menu = new Property>(original, "Menu", Enumerable.Empty); - _messages = new Property>(original, "Messages", () => new NotifyEntry[0]); - _currentUser = new Property(original, "CurrentUser", () => null); - } - - public override ZoneCollection Zones { get { return _zones.Value; } set { _zones.Value = value; } } - public override IEnumerable Menu { get { return _menu.Value; } set { _menu.Value = value; } } - public override IList Messages { get { return _messages.Value; } set { _messages.Value = value; } } - public override IUser CurrentUser { get { return _currentUser.Value; } set { _currentUser.Value = value; } } - - - class Property where TProperty : class { - private readonly ViewDataDictionary _original; - private readonly string _expression; - private Func _builder; - private TProperty _value; - - public Property(ViewDataDictionary original, string expression, Func builder) { - _original = original; - _expression = expression; - _builder = builder; - } - - public TProperty Value { - get { - if (_value == null && _builder != null) { - object temp; - if (_original.TryGetValue(_expression, out temp) && - temp is TProperty) { - SetValue(temp as TProperty); - } - else { - SetValue(_builder()); - } - } - return _value; - } - set { SetValue(value); } - } - - private void SetValue(TProperty value) { - _builder = null; - _value = value; - _original[_expression] = _value; - } - } - } -} \ No newline at end of file diff --git a/src/Orchard/Orchard.Framework.csproj b/src/Orchard/Orchard.Framework.csproj index 78df23db7..0d1925101 100644 --- a/src/Orchard/Orchard.Framework.csproj +++ b/src/Orchard/Orchard.Framework.csproj @@ -635,7 +635,6 @@ - ASPXCodeBehind