Decoupling more things, mostly to do with the PluginManager and logging which now requires an IServiceProvider so have created a simple instance of that.

This commit is contained in:
Shannon
2015-01-16 15:47:44 +11:00
parent 8f100a7e9f
commit 1cb0cd296c
77 changed files with 1105 additions and 819 deletions

View File

@@ -17,21 +17,13 @@ namespace Umbraco.Web.UI.Controls
public abstract class UmbracoControl : Control
{
protected UmbracoControl(UmbracoContext umbracoContext)
: this(LoggerResolver.Current.Logger, umbracoContext)
{
}
/// <summary>
/// Default constructor
/// </summary>
/// <param name="logger"></param>
/// <param name="umbracoContext"></param>
protected UmbracoControl(ILogger logger, UmbracoContext umbracoContext)
protected UmbracoControl(UmbracoContext umbracoContext)
{
if (logger == null) throw new ArgumentNullException("logger");
if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
Logger = logger;
UmbracoContext = umbracoContext;
Umbraco = new UmbracoHelper(umbracoContext);
}
@@ -49,7 +41,22 @@ namespace Umbraco.Web.UI.Controls
/// </summary>
public UmbracoHelper Umbraco { get; private set; }
public ILogger Logger { get; private set; }
/// <summary>
/// Returns an ILogger
/// </summary>
public ILogger Logger
{
get { return ProfilingLogger.Logger; }
}
/// <summary>
/// Returns a ProfilingLogger
/// </summary>
public ProfilingLogger ProfilingLogger
{
get { return UmbracoContext.Application.ProfilingLogger; }
}
public UmbracoContext UmbracoContext { get; private set; }
protected ApplicationContext ApplicationContext

View File

@@ -16,21 +16,13 @@ namespace Umbraco.Web.UI.Controls
/// </summary>
public abstract class UmbracoUserControl : UserControl
{
protected UmbracoUserControl(UmbracoContext umbracoContext)
: this(LoggerResolver.Current.Logger, umbracoContext)
{
}
/// <summary>
/// Default constructor
/// </summary>
/// <param name="logger"></param>
/// <param name="umbracoContext"></param>
protected UmbracoUserControl(ILogger logger, UmbracoContext umbracoContext)
protected UmbracoUserControl(UmbracoContext umbracoContext)
{
if (logger == null) throw new ArgumentNullException("logger");
if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
Logger = logger;
UmbracoContext = umbracoContext;
InstanceId = Guid.NewGuid();
Umbraco = new UmbracoHelper(umbracoContext);
@@ -73,7 +65,21 @@ namespace Umbraco.Web.UI.Controls
get { return UmbracoContext.Security; }
}
public ILogger Logger { get; private set; }
/// <summary>
/// Returns an ILogger
/// </summary>
public ILogger Logger
{
get { return ProfilingLogger.Logger; }
}
/// <summary>
/// Returns a ProfilingLogger
/// </summary>
public ProfilingLogger ProfilingLogger
{
get { return UmbracoContext.Application.ProfilingLogger; }
}
/// <summary>
/// Returns the current UmbracoContext