using System;
using System.Web.UI;
using umbraco;
using umbraco.cms.businesslogic.datatype;
using System.Web.UI.HtmlControls;
namespace umbraco.editorControls
{
///
/// Extension methods for embedded resources
///
public static class ResourceExtensions
{
///
/// Registers the embedded client resource.
///
/// The control.
/// Name of the resource.
/// The type.
public static void RegisterEmbeddedClientResource(this Control ctl, string resourceName, ClientDependencyType type)
{
ctl.RegisterEmbeddedClientResource(ctl.GetType(), resourceName, type);
}
///
/// Registers the embedded client resource.
///
/// The control.
/// The resource container.
/// Name of the resource.
/// The type.
public static void RegisterEmbeddedClientResource(this Control ctl, Type resourceContainer, string resourceName, ClientDependencyType type)
{
ctl.Page.RegisterEmbeddedClientResource(resourceContainer, resourceName, type);
}
///
/// Registers the embedded client resource.
///
/// The page.
/// The type containing the embedded resource
/// Name of the resource.
/// The type.
public static void RegisterEmbeddedClientResource(this Page page, Type resourceContainer, string resourceName, ClientDependencyType type)
{
var target = page.Header;
// if there's no