using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CMS.FormControls; public partial class CMSModules_PortalEngine_FormControls_WebPartLayouts_WebPartLayoutSelector : FormEngineUserControl { #region "Variables" private bool mShowNewItem = false; private bool mShowDefaultItem = false; #endregion #region "Properties" /// /// Value. /// public override object Value { get { return uniselect.Value; } set { uniselect.Value = value; } } /// /// Whether (New) item is shown. /// public bool ShowNewItem { get { return mShowNewItem; } set { mShowNewItem = value; } } /// /// Whehter (Defualt) item is shown. /// public bool ShowDefaultItem { get { return mShowDefaultItem; } set { mShowDefaultItem = value; } } /// /// Where condition. /// public string WhereCondition { get { return uniselect.WhereCondition; } set { uniselect.WhereCondition = value; } } #endregion #region "Methods" /// /// Page load event. /// protected void Page_Load(object sender, EventArgs e) { if (StopProcessing) { uniselect.StopProcessing = true; return; } // Get icon uniselect.IconPath = GetImageUrl("Objects/CMS_WebPartLayout/object.png"); string[,] specialFields = new string[2,2]; if (ShowDefaultItem) { specialFields[0, 0] = GetString("WebPartPropertise.Default"); specialFields[0, 1] = "|default|"; } if (ShowNewItem) { specialFields[1, 0] = GetString("WebPartPropertise.New"); specialFields[1, 1] = "|new|"; } uniselect.SpecialFields = specialFields; uniselect.DropDownSingleSelect.AutoPostBack = true; uniselect.IsLiveSite = IsLiveSite; } /// /// On changed. /// protected void uniselect_OnSelectionChanged(object sender, EventArgs e) { RaiseOnChanged(); } #endregion }