private void mnuAddNewCondition_Click(object sender, EventArgs e)
        {
            UpdateSelectedCondition(true);

            LaunchCondition condition = new LaunchCondition();

            conoditionItems.AddNewItem(condition);
        }
        void conoditionItems_ItemSelectionChanged(object sender, GridItemEventArgs e)
        {
            UpdateSelectedCondition(true);

            if (e.SelectedItem != null)
            {
                selectedCondition     = (LaunchCondition)e.SelectedItem;
                txtConditionName.Text = selectedCondition.Name;
                txtCondition.Text     = selectedCondition.Condition;
                txtFailMessage.Text   = selectedCondition.FailMessage;
            }
        }
        private void UpdateSelectedCondition(bool setSelectedItemNull)
        {
            if (selectedCondition != null)
            {
                selectedCondition.Name        = txtConditionName.Text;
                selectedCondition.Condition   = txtCondition.Text;
                selectedCondition.FailMessage = txtFailMessage.Text;

                conoditionItems.UpdateSelectedItemText(selectedCondition.Name);
            }

            if (setSelectedItemNull)
            {
                selectedCondition = null;
            }
        }
 private void mnuDeleteSelectedCondition_Click(object sender, EventArgs e)
 {
     selectedCondition = null;
     conoditionItems.DeleteSelectedItem();
 }