Esempio n. 1
0
        private void customMethod_ItemActivate(object sender, EventArgs e)
        {
            //Create the dialog
            CustomMethodEditorForm editorForm = new CustomMethodEditorForm();
            ListViewItem           item       = customMethod.SelectedItems[0];

            editorForm.Method = (CustomErasureMethod)item.Tag;

            if (editorForm.ShowDialog() == DialogResult.OK)
            {
                //Remove the old definition of the erasure method
                CustomErasureMethod method = editorForm.Method;
                if (customMethods.ContainsKey(method.Guid) &&
                    removeCustomMethods.IndexOf(method.Guid) == -1)
                {
                    removeCustomMethods.Add(method.Guid);
                }

                //Add the new definition
                foreach (CustomErasureMethod addMethod in addCustomMethods)
                {
                    if (addMethod.Guid == method.Guid)
                    {
                        addCustomMethods.Remove(addMethod);
                        break;
                    }
                }

                addCustomMethods.Add(method);
                item.Tag = method;
                UpdateMethod(item);
            }
        }
Esempio n. 2
0
 private void customMethodAdd_Click(object sender, EventArgs e)
 {
     CustomMethodEditorForm form = new CustomMethodEditorForm();
        if (form.ShowDialog() == DialogResult.OK)
        {
     CustomErasureMethod method = form.Method;
     addCustomMethods.Add(method);
     AddMethod(method);
        }
 }
Esempio n. 3
0
        private void customMethodAdd_Click(object sender, EventArgs e)
        {
            CustomMethodEditorForm form = new CustomMethodEditorForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                CustomErasureMethod method = form.Method;
                addCustomMethods.Add(method);
                AddMethod(method);
            }
        }
Esempio n. 4
0
 private void customMethod_ItemActivate(object sender, EventArgs e)
 {
     CustomMethodEditorForm editorForm = new CustomMethodEditorForm();
        ListViewItem item = customMethod.SelectedItems[0];
        editorForm.Method = (CustomErasureMethod)item.Tag;
        if (editorForm.ShowDialog() == DialogResult.OK)
        {
     CustomErasureMethod method = editorForm.Method;
     removeCustomMethods.Add(method.Guid);
     customMethod.Items.Remove(item);
     customMethods.Remove(method.Guid);
     method = editorForm.Method;
     addCustomMethods.Add(method);
     AddMethod(method);
        }
 }
Esempio n. 5
0
 private void customMethod_ItemActivate(object sender, EventArgs e)
 {
     CustomMethodEditorForm editorForm = new CustomMethodEditorForm();
        ListViewItem item = customMethod.SelectedItems[0];
        editorForm.Method = (CustomErasureMethod)item.Tag;
        if (editorForm.ShowDialog() == DialogResult.OK)
        {
     CustomErasureMethod method = editorForm.Method;
     if (customMethods.ContainsKey(method.Guid) &&
      removeCustomMethods.IndexOf(method.Guid) == -1)
     {
      removeCustomMethods.Add(method.Guid);
     }
     foreach (CustomErasureMethod addMethod in addCustomMethods)
     {
      if (addMethod.Guid == method.Guid)
      {
       addCustomMethods.Remove(addMethod);
       break;
      }
     }
     addCustomMethods.Add(method);
     item.Tag = method;
     UpdateMethod(item);
        }
 }