Web.Mvc - Refactor UmbracoViewPage, UmbracoTemplatePage, support strongly-typed content

Conflicts:
	src/Umbraco.Web/Umbraco.Web.csproj
This commit is contained in:
Stephan
2013-10-23 10:13:54 +02:00
parent 4487e686d7
commit 128a08f169
10 changed files with 812 additions and 243 deletions

View File

@@ -1,13 +1,14 @@
using System;
using System.Globalization;
using Umbraco.Core.Models;
using Umbraco.Web.Mvc;
namespace Umbraco.Web.Models
{
/// <summary>
/// Represents the model for the current rendering page in Umbraco
/// </summary>
public class RenderModel
public class RenderModel : IRenderModel
{
/// <summary>
/// Constructor specifying both the IPublishedContent and the CultureInfo
@@ -16,7 +17,7 @@ namespace Umbraco.Web.Models
/// <param name="culture"></param>
public RenderModel(IPublishedContent content, CultureInfo culture)
{
if (content == null) throw new ArgumentNullException("content");
if (content == null) throw new ArgumentNullException("content");
if (culture == null) throw new ArgumentNullException("culture");
Content = content;
CurrentCulture = culture;
@@ -28,7 +29,7 @@ namespace Umbraco.Web.Models
/// <param name="content"></param>
public RenderModel(IPublishedContent content)
{
if (content == null) throw new ArgumentNullException("content");
if (content == null) throw new ArgumentNullException("content");
if (UmbracoContext.Current == null)
{
throw new InvalidOperationException("Cannot construct a RenderModel without specifying a CultureInfo when no UmbracoContext has been initialized");