示例#1
0
 private void ActivateLimitEditor(ResultDef.LimitDefBase Limit)
 {
     DisableEditors();
     if (Limit.GetType().Equals(typeof(ResultDef.LimitDefBool)))
     {
         m_LimitDefBoolEditor.SetData((ResultDef.LimitDefBool)Limit);
         m_LimitDefBoolEditor.Visible = true;
         btApply.Enabled = true;
     }
     else if (Limit.GetType().Equals(typeof(ResultDef.LimitDefDouble)))
     {
         m_LimitDefDoubleEditor.SetData((ResultDef.LimitDefDouble)Limit);
         m_LimitDefDoubleEditor.Visible = true;
         btApply.Enabled = true;
     }
 }
示例#2
0
        /*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();
        }