using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.interfaces;
using umbraco.cms.businesslogic.datatype;
[assembly: WebResource("umbraco.editorControls.PrevalueEditor.css", "text/css")]
namespace umbraco.editorControls
{
///
/// Abstract class for the PreValue Editor.
///
public abstract class AbstractPrevalueEditor : WebControl, IDataPrevalue
{
///
/// Initializes a new instance of the class.
///
public AbstractPrevalueEditor()
: base()
{
}
///
/// Gets the editor.
///
/// The editor.
public virtual Control Editor
{
get
{
return this;
}
}
///
/// Saves this instance.
///
public virtual void Save()
{
}
///
/// Raises the event.
///
/// An object that contains the event data.
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.EnsureChildControls();
// Adds the client dependencies.
this.RegisterEmbeddedClientResource("umbraco.editorControls.PrevalueEditor.css", ClientDependencyType.Css);
}
///
/// Renders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers.
///
/// A that represents the output stream to render HTML content on the client.
public override void RenderBeginTag(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Class, "PrevalueEditor");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
base.RenderBeginTag(writer);
}
///
/// Renders the HTML closing tag of the control into the specified writer. This method is used primarily by control developers.
///
/// A that represents the output stream to render HTML content on the client.
public override void RenderEndTag(HtmlTextWriter writer)
{
base.RenderEndTag(writer);
writer.RenderEndTag();
}
}
}