Remove Umbraco.Web.UI.Controls folder & classes - Controis reek of WebForms era

This commit is contained in:
Warren Buckley
2019-01-23 17:57:20 +00:00
parent 03498b3c61
commit fcb3f8e791
4 changed files with 0 additions and 192 deletions

View File

@@ -1,17 +0,0 @@
using Umbraco.Core.IO;
namespace Umbraco.Web.UI.Controls
{
public class ProgressBar : System.Web.UI.WebControls.Image
{
public string Title { get; set; }
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
base.ImageUrl = "/images/progressBar.gif";
base.AlternateText = Title;
base.Render(writer);
}
}
}

View File

@@ -1,67 +0,0 @@
using System;
using System.Web.Mvc;
using System.Web.UI;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Web.Composing;
namespace Umbraco.Web.UI.Controls
{
/// <summary>
/// A control that exposes the helpful Umbraco context objects
/// </summary>
public abstract class UmbracoControl : Control
{
private UrlHelper _url;
protected UmbracoControl(UmbracoContext umbracoContext, ServiceContext services)
{
UmbracoContext = umbracoContext ?? throw new ArgumentNullException(nameof(umbracoContext));
Umbraco = new UmbracoHelper(umbracoContext, services);
// todo inject somehow
Logger = Current.Logger;
ProfilingLogger = Current.ProfilingLogger;
Services = Current.Services;
}
/// <summary>
/// Empty constructor, uses Singleton to resolve the UmbracoContext.
/// </summary>
protected UmbracoControl()
: this(Current.UmbracoContext, Current.Services)
{ }
/// <summary>
/// Returns an UmbracoHelper object
/// </summary>
public UmbracoHelper Umbraco { get; }
/// <summary>
/// Gets the logger.
/// </summary>
public ILogger Logger { get; }
/// <summary>
/// Gets the profiling logger.
/// </summary>
public IProfilingLogger ProfilingLogger { get; }
/// <summary>
/// Gets the Umbraco context.
/// </summary>
public UmbracoContext UmbracoContext { get; }
/// <summary>
/// Gets the services context.
/// </summary>
protected ServiceContext Services { get; }
/// <summary>
/// Gets a Url helper.
/// </summary>
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext));
}
}

View File

@@ -1,103 +0,0 @@
using System;
using System.Web.Mvc;
using System.Web.UI;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Web.Security;
using Umbraco.Web.UI.Pages;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Web.UI.Controls
{
/// <summary>
/// A base class for all Presentation UserControls to inherit from
/// </summary>
public abstract class UmbracoUserControl : UserControl
{
private ClientTools _clientTools;
private UrlHelper _url;
/// <summary>
/// Default constructor
/// </summary>
/// <param name="umbracoContext"></param>
/// <param name="services"></param>
protected UmbracoUserControl(UmbracoContext umbracoContext, ServiceContext services)
{
if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext));
UmbracoContext = umbracoContext;
Umbraco = new UmbracoHelper(umbracoContext, services);
Members = Current.Factory.GetInstance<MembershipHelper>();
// todo inject somehow
Logger = Current.Logger;
ProfilingLogger = Current.ProfilingLogger;
Services = Current.Services;
}
/// <summary>
/// Empty constructor, uses Singleton to resolve the UmbracoContext
/// </summary>
protected UmbracoUserControl()
: this(Current.UmbracoContext, Current.Services)
{ }
// for debugging purposes
internal Guid InstanceId { get; } = Guid.NewGuid();
/// <summary>
/// Gets the Umbraco helper.
/// </summary>
public UmbracoHelper Umbraco { get; }
/// <summary>
/// Gets the membership helper;
/// </summary>
public MembershipHelper Members { get; }
/// <summary>
/// Gets the web security helper.
/// </summary>
public WebSecurity Security => UmbracoContext.Security;
/// <summary>
/// Gets the logger.
/// </summary>
public ILogger Logger { get; }
/// <summary>
/// Gets the ProfilingLogger.
/// </summary>
public IProfilingLogger ProfilingLogger { get; }
/// <summary>
/// Gets the Umbraco context.
/// </summary>
public UmbracoContext UmbracoContext { get; }
/// <summary>
/// Gets the services context.
/// </summary>
public ServiceContext Services { get; }
/// <summary>
/// Gets an instance of ClientTools for access to the pages client API.
/// </summary>
public ClientTools ClientTools
{
get
{
var page = Page as BasePage;
return _clientTools ?? (_clientTools = page != null ? page.ClientTools : new ClientTools(Page));
}
}
/// <summary>
/// Gets a Url helper.
/// </summary>
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext));
}
}

View File

@@ -1145,11 +1145,6 @@
<Compile Include="_Legacy\UI\ITaskReturnUrl.cs" />
<Compile Include="_Legacy\UI\LegacyDialogHandler.cs" />
<Compile Include="_Legacy\UI\LegacyDialogTask.cs" />
<Compile Include="UI\Controls\ProgressBar.cs" />
<Compile Include="UI\Controls\UmbracoControl.cs" />
<Compile Include="UI\Controls\UmbracoUserControl.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UI\Pages\BasePage.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>