private DashboardSettings GetSetting(string objectId) { DashboardSettings result = null; if (dashboardSettingsProvider != null) { result = dashboardSettingsProvider.Load(objectId); } if (result == null) { result = new DashboardSettings(); result.Closed = false; result.Expanded = true; } return(result); }
private void SaveSettings() { try { if (Page.Request["settings"] == null) { return; } settings = DashboardSettings.fromJSONString(Page.Request["settings"]); if (settings != null) { dashboardSettingsProvider.Save(settings, ClientID); } } catch (Exception ex) { Util.Log.Error("Datsboard::SaveSettings", ex); } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param> protected override void OnInit(EventArgs e) { Attributes.Add("instanceName", JSObjectName); Attributes.Add("class", "dragableBox"); Attributes.CssStyle.Add("position", "static"); Layout.ID = ID + "_Layout"; Layout.JSObjectName = JSObjectName; Layout.ImageUrl = imageUrl; Controls.Add(Layout); handler.ID = ID + "AJAXHandler"; handler.ContentProcessor = OnAJAXRequest; Controls.Add(handler); base.OnInit(e); settings = GetSetting(ClientID); }