Files
Umbraco-CMS/src/Umbraco.Web/UI/Controls/UmbracoControl.cs
Shannon Deminick b292cb3ab3 Crated InsertMacroSplitButton webforms control instead of the hacky js code used to insert the split button in the template editor.
Have implemented it now in the EditView (will transition over its use in editTemplate soon but is low priority).
Have got the js callbacks working now for inserting a macro for the mvc editor but need to implement the correct syntax. Also need
to migrate and update the editMacro dialog screen to check if we are rendering for MVC or not and if it is MVC then use the correct
syntax.
2012-12-31 18:39:36 +03:00

50 lines
1.1 KiB
C#

using System.Web.UI;
using Umbraco.Core;
using Umbraco.Core.Services;
using umbraco.BusinessLogic;
using umbraco.DataLayer;
namespace Umbraco.Web.UI.Controls
{
/// <summary>
/// A control that exposes the helpful Umbraco context objects
/// </summary>
internal class UmbracoControl : Control
{
public UmbracoControl(UmbracoContext umbracoContext)
{
_umbracoContext = umbracoContext;
}
public UmbracoControl()
{
}
private UmbracoContext _umbracoContext;
protected UmbracoContext UmbracoContext
{
get { return _umbracoContext ?? (_umbracoContext = UmbracoContext.Current); }
}
protected ApplicationContext ApplicationContext
{
get { return UmbracoContext.Application; }
}
protected DatabaseContext DatabaseContext
{
get { return ApplicationContext.DatabaseContext; }
}
protected ServiceContext Services
{
get { return ApplicationContext.Services; }
}
/// <summary>
/// Returns the legacy SqlHelper
/// </summary>
protected ISqlHelper SqlHelper
{
get { return Application.SqlHelper; }
}
}
}