Changeset 1488
- Timestamp:
- 1/9/2010 4:10:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/6.0/Eraser.DefaultPlugins/SettingsForm.cs
r1484 r1488 95 95 //Remove the old definition of the erasure method 96 96 CustomErasureMethod method = editorForm.Method; 97 if (removeCustomMethods.IndexOf(method.Guid) == -1) 97 if (customMethods.ContainsKey(method.Guid) && 98 removeCustomMethods.IndexOf(method.Guid) == -1) 99 { 98 100 removeCustomMethods.Add(method.Guid); 101 } 99 102 100 103 //Add the new definition 101 104 foreach (CustomErasureMethod addMethod in addCustomMethods) 105 { 102 106 if (addMethod.Guid == method.Guid) 103 107 { … … 105 109 break; 106 110 } 107 108 customMethods[method.Guid] = method; 111 } 112 109 113 addCustomMethods.Add(method); 110 114 item.Tag = method; 115 UpdateMethod(item); 111 116 } 112 117 } … … 185 190 } 186 191 192 /// <summary> 193 /// Updates the UI which represents the given custom erasure method. 194 /// </summary> 195 /// <param name="item">The method to update.</param> 196 private void UpdateMethod(ListViewItem item) 197 { 198 CustomErasureMethod method = (CustomErasureMethod)item.Tag; 199 item.Text = method.Name; 200 item.SubItems[1].Text = method.Passes.Length.ToString(CultureInfo.CurrentCulture); 201 } 202 187 203 private Dictionary<Guid, CustomErasureMethod> customMethods; 188 204 private List<CustomErasureMethod> addCustomMethods = new List<CustomErasureMethod>();
Note: See TracChangeset
for help on using the changeset viewer.
