private void ActivateStepEditor(ResultDef.TestStepBase Step) { DisableEditors(); m_TestStepEditor.SetData(Step, m_ResultDef); m_TestStepEditor.Visible = true; btApply.Enabled = true; }
private void TestGrid_SelectionChanged(object sender, EventArgs e) { DisableEditors(); LimitGrid.ClearSelection(); if (TestGrid.SelectedRows.Count > 0) { string Name = (string)TestGrid.SelectedRows[0].Cells[TestStep.Index].Value; ResultDef.TestStepBase Step = null; m_ResultDef.GetResultValue(Name, out Step); ActivateStepEditor(Step); } ; }
/*private void UpdateLimitCombo() * { * this.Limit.Items.Clear(); * ICollection LimitNames = m_ResultDef.GetLimitNames(); * foreach (string Name in LimitNames) * { * this.Limit.Items.Add(Name); * } * }*/ private void btApply_Click(object sender, EventArgs e) { ResultDef.LimitDefBase Limit = null; if (m_LimitDefBoolEditor.Visible) { Limit = m_LimitDefBoolEditor.GetData(); } else if (m_LimitDefDoubleEditor.Visible) { Limit = m_LimitDefDoubleEditor.GetData(); } if (Limit != null) { if (m_ResultDef.LimitExists(Limit.GetName())) { m_ResultDef.ModifyLimit(Limit); } else { m_ResultDef.AddLimit(Limit); } } ResultDef.TestStepBase Step = null; if (m_TestStepEditor.Visible) { Step = m_TestStepEditor.GetData(); } if (Step != null) { if (m_ResultDef.TestStepExists(Step.GetName())) { m_ResultDef.ModifyTestStep(Step); } else { m_ResultDef.AddTestStep(Step); } } UpdateDisplay(); }