/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event. /// </summary> /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { BindDropDown(); SystemTest monitorTest = GetMonitorTest(); if (monitorTest != null && monitorTest.Id != 0) { ViewState["EntityTypeId"] = monitorTest.EntityTypeId; BindAlarmDropDown(monitorTest.EntityTypeId); ddlComponent.Visible = false; ltName.Text = monitorTest.Name; tbName.Text = monitorTest.Name; tbInterval.Text = monitorTest.RunIntervalMinutes.ToString(); ddlAlarmCondition.SetValue(Convert.ToInt32(monitorTest.AlarmCondition).ToString()); monitorTest.LoadAttributes(); Rock.Attribute.Helper.AddEditControls(monitorTest, phAttributes, true, "", exclude: _attributeExclusion); } else { ddlComponent.Required = true; } } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Load" /> event. /// </summary> /// <param name="e">The <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { BindDropDown(); BindAlarmNotificationDropDown(); SystemTest monitorTest = GetMonitorTest(); if (monitorTest != null && monitorTest.Id != 0) { ViewState["EntityTypeId"] = monitorTest.EntityTypeId; BindAlarmDropDown(monitorTest.EntityTypeId); ddlComponent.Visible = false; ltName.Text = monitorTest.Name; tbName.Text = monitorTest.Name; tbInterval.Text = monitorTest.RunIntervalMinutes.ToString(); ddlAlarmCondition.SetValue(Convert.ToInt32(monitorTest.AlarmCondition).ToString()); foreach (ListItem item in cblAlarmNotification.Items) { var alarmcondition = ( AlarmNotification )item.Value.AsInteger(); item.Selected = (alarmcondition & monitorTest.AlarmNotification) == ( AlarmNotification )Enum.Parse(typeof(AlarmNotification), item.Text); } monitorTest.LoadAttributes(); Rock.Attribute.Helper.AddEditControls(monitorTest, phAttributes, true, "", exclude: _attributeExclusion); } else { ddlComponent.Required = true; } } }
public void GetClassSingleton() { SystemTest theTest = new SystemTest(true); locator.Register <Test>(theTest); Test test = locator.Get <Test>(); Assert.AreSame(theTest, test); }
private SystemTest GetMonitorTest(SystemTestService monitorTestService) { var testId = PageParameter("MonitorTestId").AsInteger(); var monitorTest = monitorTestService.Get(testId); if (monitorTest == null) { monitorTest = new SystemTest(); } return(monitorTest); }
protected void ddlComponent_SelectedIndexChanged(object sender, EventArgs e) { SystemTest monitorTest = new SystemTest { EntityTypeId = ddlComponent.SelectedValueAsId() }; monitorTest.LoadAttributes(); ViewState["EntityTypeId"] = monitorTest.EntityTypeId; BindAlarmDropDown(monitorTest.EntityTypeId); Rock.Attribute.Helper.AddEditControls(monitorTest, phAttributes, true, "", exclude: _attributeExclusion); }
public abstract SystemTestResult RunTest(SystemTest monitorTest);