Exemplo n.º 1
0
        /// <summary>
        /// Generated when the user double-clicks an item in the list-view.
        /// </summary>
        /// <param name="sender">The list-view which generated this event.</param>
        /// <param name="e">Event argument.</param>
        private void data_ItemActivate(object sender, EventArgs e)
        {
            using (TaskDataSelectionForm form = new TaskDataSelectionForm())
            {
                form.Target = task.Targets[data.SelectedIndices[0]];

                if (form.ShowDialog() == DialogResult.OK)
                {
                    IErasureTarget target = form.Target;
                    task.Targets.RemoveAt(data.SelectedIndices[0]);
                    task.Targets.Insert(data.SelectedIndices[0], target);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Triggered when the user clicks on the Add Data button.
        /// </summary>
        /// <param name="sender">The button.</param>
        /// <param name="e">Event argument.</param>
        private void dataAdd_Click(object sender, EventArgs e)
        {
            using (TaskDataSelectionForm form = new TaskDataSelectionForm())
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    IErasureTarget target = form.Target;
                    task.Targets.Add(target);
                    errorProvider.Clear();

                    ++data.VirtualListSize;
                }
            }
        }
Exemplo n.º 3
0
 private void data_ItemActivate(object sender, EventArgs e)
 {
     using (TaskDataSelectionForm form = new TaskDataSelectionForm())
        {
     ListViewItem item = data.SelectedItems[0];
     form.Target = task.Targets[item.Index];
     if (form.ShowDialog() == DialogResult.OK)
     {
      ErasureTarget target = form.Target;
      task.Targets[item.Index] = target;
      item.Text = target.UIText;
      item.SubItems[1].Text = target.MethodDefined ? target.Method.Name : S._("(default)");
     }
        }
 }
Exemplo n.º 4
0
 private void dataAdd_Click(object sender, EventArgs e)
 {
     using (TaskDataSelectionForm form = new TaskDataSelectionForm())
        {
     if (form.ShowDialog() == DialogResult.OK)
     {
      ErasureTarget target = form.Target;
      ListViewItem item = data.Items.Add(target.UIText);
      item.SubItems.Add(target.MethodDefined ? target.Method.Name : S._("(default)"));
      item.Tag = target;
      task.Targets.Add(target);
      errorProvider.Clear();
     }
        }
 }