コード例 #1
0
 private void AddExternalLibParamsButton_Click(object sender, EventArgs e)
 {
     try {
         ExternalLibParamsForm form = new ExternalLibParamsForm();
         if (form.ShowDialog() == DialogResult.OK)
         {
             _task.ExternalLibParams = new Dictionary <string, object>();
             _task.ExternalLibParams.Add(form.Param.Key, form.Param.Value);
             UpdateExternalLibParams();
         }
     }
     catch (Exception ex) {
         MessageBox.Show(ex.ToString(), "ќшибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #2
0
        private void EditExternalLibParamsButton_Click(object sender, EventArgs e)
        {
            try {
                if (ExternalLibParamsView.SelectedItems.Count < 1)
                {
                    System.Media.SystemSounds.Beep.Play();
                    return;
                }
                KeyValuePair <string, object> itemData = (KeyValuePair <string, object>)ExternalLibParamsView.SelectedItems[0].Tag;

                ExternalLibParamsForm form = new ExternalLibParamsForm(itemData);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    _task.ExternalLibParams.Remove(itemData.Key);
                    _task.ExternalLibParams.Add(form.Param.Key, form.Param.Value);
                    UpdateExternalLibParams();
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.ToString(), "ќшибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }