using System;
using System.Data;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CMS.ExtendedControls;
using CMS.GlobalHelper;
using CMS.PortalControls;
public partial class CMSWebParts_Wireframe_Components_Icon: CMSAbstractWebPart
{
#region "Properties"
///
/// Image
///
public string ImageUrl
{
get
{
return ValidationHelper.GetString(this.GetValue("ImageUrl"), "CMSModules/CMS_PortalEngine/Wireframes/icon.png");
}
set
{
this.SetValue("ImageUrl", value);
}
}
///
/// Icon size
///
public string Size
{
get
{
return ValidationHelper.GetString(this.GetValue("Size"), "M");
}
set
{
this.SetValue("Size", value);
}
}
///
/// Icon label
///
public string Label
{
get
{
return ValidationHelper.GetString(this.GetValue("Label"), "");
}
set
{
this.SetValue("Label", value);
}
}
///
/// Label position
///
public string LabelPosition
{
get
{
return ValidationHelper.GetString(this.GetValue("LabelPosition"), "");
}
set
{
this.SetValue("LabelPosition", value);
}
}
#endregion
///
/// Content loaded event handler.
///
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}
///
/// Initializes the control properties.
///
protected void SetupControl()
{
if (StopProcessing)
{
// Do not process
}
else
{
imgElem.ImageUrl = UIHelper.GetImageUrl(this.Page, ImageUrl);
imgElem.Attributes.Add("ondragstart", "return false");
imgElem.CssClass = this.Size;
ltlText.Text = this.Label;
if (!this.LabelPosition.Equals("right", StringComparison.InvariantCultureIgnoreCase))
{
ltlText.CssClass += " Block";
}
}
}
///
/// Reloads the control data.
///
public override void ReloadData()
{
base.ReloadData();
SetupControl();
}
}