Files
Umbraco-CMS/src/Umbraco.Web/Models/PartialViewMacroModel.cs

49 lines
1.5 KiB
C#
Raw Normal View History

2013-03-06 04:12:28 +06:00
using System;
2012-12-04 03:29:02 +05:00
using System.Collections.Generic;
2013-03-06 04:12:28 +06:00
using System.ComponentModel;
2012-12-04 03:29:02 +05:00
using Umbraco.Core.Models;
namespace Umbraco.Web.Models
{
/// <summary>
/// The model used when rendering Partial View Macros
/// </summary>
public class PartialViewMacroModel
{
2012-12-04 03:29:02 +05:00
public PartialViewMacroModel(IPublishedContent page,
int macroId,
string macroAlias,
string macroName,
2013-03-06 04:12:28 +06:00
IDictionary<string, object> macroParams)
{
Content = page;
MacroParameters = macroParams;
MacroName = macroName;
MacroAlias = macroAlias;
MacroId = macroId;
}
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use the constructor accepting the macro id instead")]
public PartialViewMacroModel(IPublishedContent page, IDictionary<string, object> macroParams)
{
2013-03-06 04:12:28 +06:00
Content = page;
MacroParameters = macroParams;
}
2012-12-04 03:29:02 +05:00
2013-03-06 04:12:28 +06:00
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use the Content property instead")]
public IPublishedContent CurrentPage
{
get { return Content; }
}
2012-12-04 03:29:02 +05:00
2013-03-06 04:12:28 +06:00
public IPublishedContent Content { get; private set; }
public string MacroName { get; private set; }
public string MacroAlias { get; private set; }
public int MacroId { get; private set; }
public IDictionary<string, object> MacroParameters { get; private set; }
2012-12-04 03:29:02 +05:00
}
2012-12-04 03:29:02 +05:00
}