コード例 #1
0
ファイル: MainForm.cs プロジェクト: linhnvfpt/homework
        private void frmMainForm_btnDelAssertParam_Click(object sender, EventArgs e)
        {
            AssertParameters parameters = new AssertParameters();

            // Get data of item will delete
            if (frmMainForm_lstAssertProperties.SelectedItems.Count < 0)
            {
                return;
            }
            foreach (ListViewItem eachItem in frmMainForm_lstAssertProperties.SelectedItems)
            {
                frmMainForm_lstAssertProperties.Items.Remove(eachItem);
                parameters.name    = eachItem.SubItems[0].Text;
                parameters.value   = eachItem.SubItems[1].Text;
                parameters.operate = eachItem.SubItems[2].Text;
                parameters.epsilon = eachItem.SubItems[3].Text;
            }

            // Get command name is selected
            string nameAssertSelected = frmMain_lstAssert.GetItemText(frmMain_lstAssert.SelectedItem);
            Assert assertSelected     = Asserts.Find(x => x.Name.Equals(nameAssertSelected));

            if (assertSelected == null)
            {
                return;
            }

            // Delete parameters of command is selected
            assertSelected.GetListParam().Remove(parameters);
        }
コード例 #2
0
ファイル: Assert.cs プロジェクト: linhnvfpt/homework
 public void AddParameter(AssertParameters dataParam)
 {
     assertParameters.Add(dataParam);
 }