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_Text_Note : CMSAbstractWebPart { #region "Properties" /// /// Text /// public string Text { get { return ValidationHelper.GetString(this.GetValue("Text"), ""); } set { this.SetValue("Text", value); } } /// /// Mark text /// public string MarkText { get { return ValidationHelper.GetString(this.GetValue("MarkText"), "1"); } set { this.SetValue("MarkText", value); } } /// /// Color /// public string Color { get { return ValidationHelper.GetString(this.GetValue("Color"), "#fd0"); } set { this.SetValue("Color", 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 { ltlText.Text = GetWireframeText(Text, false); ltlMark.Text = MarkText; // Height string h = WebPartHeight; if (!String.IsNullOrEmpty(h)) { ltlText.Style += String.Format("height: {0};", h); } // Width string w = WebPartWidth; if (!String.IsNullOrEmpty(w)) { ltlText.Style += String.Format("width: {0};", w); } resElem.ResizedElementID = ltlText.ClientID; ltlText.Style += String.Format("background-color: {0}", Color); colElem.Color = Color; colElem.TargetElementID = ltlText.ClientID; } } /// /// Reloads the control data. /// public override void ReloadData() { base.ReloadData(); SetupControl(); } }