Changeset 2440
- Timestamp:
- 3/10/2012 1:35:11 PM (15 months ago)
- Location:
- branches/eraser6/pluginsRewrite
- Files:
-
- 12 edited
-
Eraser.BlackBox/Properties/AssemblyInfo.cs (modified) (1 diff)
-
Eraser.Manager/DirectExecutor.cs (modified) (1 diff)
-
Eraser.Manager/ErasureTargetCollection.cs (modified) (10 diffs)
-
Eraser.Manager/ManagerLibrary.cs (modified) (1 diff)
-
Eraser.Manager/Task.cs (modified) (3 diffs)
-
Eraser.Plugins/Eraser.Plugins.csproj (modified) (1 diff)
-
Eraser.Plugins/Registrars/ErasureMethodRegistrar.cs (modified) (3 diffs)
-
Eraser.Plugins/Registrars/ErasureTargetFactoryRegistrar.cs (modified) (1 diff)
-
Eraser.Plugins/Registrars/FileSystemRegistrar.cs (modified) (2 diffs)
-
Eraser.Plugins/Registrars/PrngRegistrar.cs (modified) (3 diffs)
-
Eraser/SettingsPanel.cs (modified) (2 diffs)
-
Eraser/TaskDataSelectionForm.cs (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/pluginsRewrite/Eraser.BlackBox/Properties/AssemblyInfo.cs
r2294 r2440 26 26 27 27 // The plugin is an optional Eraser plugin, which should default to not load. 28 [assembly: Eraser.Plugins. LoadingPolicy(Eraser.Plugins.LoadingPolicy.DefaultOff)]28 [assembly: Eraser.Plugins.PluginLoadingPolicy(Eraser.Plugins.PluginLoadingPolicy.DefaultOff)] -
branches/eraser6/pluginsRewrite/Eraser.Manager/DirectExecutor.cs
r2380 r2440 287 287 288 288 //Run the task 289 foreach ( ErasureTarget target in task.Targets)289 foreach (IErasureTarget target in task.Targets) 290 290 try 291 291 { -
branches/eraser6/pluginsRewrite/Eraser.Manager/ErasureTargetCollection.cs
r2365 r2440 39 39 /// </summary> 40 40 [Serializable] 41 public class ErasureTargetCollection : IList< ErasureTarget>, ISerializable41 public class ErasureTargetCollection : IList<IErasureTarget>, ISerializable 42 42 { 43 43 #region Constructors 44 44 internal ErasureTargetCollection(Task owner) 45 45 { 46 this.list = new List< ErasureTarget>();46 this.list = new List<IErasureTarget>(); 47 47 this.owner = owner; 48 48 } … … 54 54 } 55 55 56 internal ErasureTargetCollection(Task owner, IEnumerable< ErasureTarget> targets)56 internal ErasureTargetCollection(Task owner, IEnumerable<IErasureTarget> targets) 57 57 : this(owner) 58 58 { … … 64 64 protected ErasureTargetCollection(SerializationInfo info, StreamingContext context) 65 65 { 66 list = (List< ErasureTarget>)info.GetValue("list", typeof(List<ErasureTarget>));66 list = (List<IErasureTarget>)info.GetValue("list", typeof(List<IErasureTarget>)); 67 67 } 68 68 … … 75 75 76 76 #region IEnumerable<ErasureTarget> Members 77 public IEnumerator< ErasureTarget> GetEnumerator()77 public IEnumerator<IErasureTarget> GetEnumerator() 78 78 { 79 79 return list.GetEnumerator(); … … 89 89 90 90 #region ICollection<ErasureTarget> Members 91 public void Add( ErasureTarget item)91 public void Add(IErasureTarget item) 92 92 { 93 93 list.Add(item); … … 96 96 public void Clear() 97 97 { 98 foreach ( ErasureTarget item in list)98 foreach (IErasureTarget item in list) 99 99 Remove(item); 100 100 } 101 101 102 public bool Contains( ErasureTarget item)102 public bool Contains(IErasureTarget item) 103 103 { 104 104 return list.Contains(item); 105 105 } 106 106 107 public void CopyTo( ErasureTarget[] array, int arrayIndex)107 public void CopyTo(IErasureTarget[] array, int arrayIndex) 108 108 { 109 109 list.CopyTo(array, arrayIndex); … … 126 126 } 127 127 128 public bool Remove( ErasureTarget item)128 public bool Remove(IErasureTarget item) 129 129 { 130 130 int index = list.IndexOf(item); … … 138 138 139 139 #region IList<ErasureTarget> Members 140 public int IndexOf( ErasureTarget item)140 public int IndexOf(IErasureTarget item) 141 141 { 142 142 return list.IndexOf(item); 143 143 } 144 144 145 public void Insert(int index, ErasureTarget item)145 public void Insert(int index, IErasureTarget item) 146 146 { 147 147 list.Insert(index, item); … … 153 153 } 154 154 155 public ErasureTarget this[int index]155 public IErasureTarget this[int index] 156 156 { 157 157 get … … 184 184 /// The list bring the data store behind this object. 185 185 /// </summary> 186 private List< ErasureTarget> list;186 private List<IErasureTarget> list; 187 187 } 188 188 } -
branches/eraser6/pluginsRewrite/Eraser.Manager/ManagerLibrary.cs
r2378 r2440 95 95 //There's no approval or denial, what is the specified loading policy? 96 96 else 97 e.Load = e.Plugin.LoadingPolicy != LoadingPolicy.DefaultOff;97 e.Load = e.Plugin.LoadingPolicy != PluginLoadingPolicy.DefaultOff; 98 98 } 99 99 -
branches/eraser6/pluginsRewrite/Eraser.Manager/Task.cs
r2406 r2440 125 125 { 126 126 //Simpler case, small set of data. 127 foreach ( ErasureTarget tgt in Targets)127 foreach (IErasureTarget tgt in Targets) 128 128 result += S._("{0}, ", tgt.UIText); 129 129 … … 272 272 /// object. 273 273 /// </summary> 274 /// <param name="sender">The <see cref=" ErasureTarget"/> which is reporting274 /// <param name="sender">The <see cref="IErasureTarget"/> which is reporting 275 275 /// progress.</param> 276 276 /// <param name="e">The new progress value.</param> … … 278 278 /// <see cref="TaskProgressEventargs"/></exception> 279 279 /// <exception cref="ArgumentNullException">Both sender and e cannot be null.</exception> 280 internal void OnProgressChanged( ErasureTarget sender, ProgressChangedEventArgs e)280 internal void OnProgressChanged(IErasureTarget sender, ProgressChangedEventArgs e) 281 281 { 282 282 if (sender == null) -
branches/eraser6/pluginsRewrite/Eraser.Plugins/Eraser.Plugins.csproj
r2438 r2440 54 54 </Compile> 55 55 <Compile Include="AssemblyInfo.cs" /> 56 <Compile Include="ExtensionPoints\ EntropySource.cs" />57 <Compile Include="ExtensionPoints\ ErasureMethod.cs" />58 <Compile Include="ExtensionPoints\ ErasureTarget.cs" />59 <Compile Include="ExtensionPoints\ FileSystem.cs" />56 <Compile Include="ExtensionPoints\IEntropySource.cs" /> 57 <Compile Include="ExtensionPoints\IErasureMethod.cs" /> 58 <Compile Include="ExtensionPoints\IErasureTarget.cs" /> 59 <Compile Include="ExtensionPoints\IFileSystem.cs" /> 60 60 <Compile Include="ExtensionPoints\Prng.cs" /> 61 61 <Compile Include="IConfigurer.cs" /> -
branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/ErasureMethodRegistrar.cs
r2358 r2440 38 38 /// do not have run-time equivalents; they all are compile-time. 39 39 /// </summary> 40 public class ErasureMethodRegistrar : Registrar< ErasureMethod>40 public class ErasureMethodRegistrar : Registrar<IErasureMethod> 41 41 { 42 42 #region Default Erasure method 43 private class DefaultMethod : ErasureMethod43 private class DefaultMethod : IErasureMethod 44 44 { 45 45 public DefaultMethod() … … 68 68 } 69 69 70 public override void Erase(Stream strm, long erasureLength, Prng prng,71 ErasureMethod.ErasureMethodProgressFunction callback)70 public override void Erase(Stream strm, long erasureLength, IPrng prng, 71 IErasureMethod.ErasureMethodProgressFunction callback) 72 72 { 73 73 throw new InvalidOperationException("The DefaultMethod class should never " + … … 82 82 /// </summary> 83 83 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] 84 public static readonly ErasureMethod Default = new DefaultMethod();84 public static readonly IErasureMethod Default = new DefaultMethod(); 85 85 #endregion 86 86 } -
branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/ErasureTargetFactoryRegistrar.cs
r2358 r2440 29 29 namespace Eraser.Plugins.Registrars 30 30 { 31 public class ErasureTargetFactoryRegistrar : FactoryRegistrar< ErasureTarget>31 public class ErasureTargetFactoryRegistrar : FactoryRegistrar<IErasureTarget> 32 32 { 33 33 } -
branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/FileSystemRegistrar.cs
r2358 r2440 30 30 namespace Eraser.Plugins.Registrars 31 31 { 32 public class FileSystemRegistrar : Registrar< FileSystem>32 public class FileSystemRegistrar : Registrar<IFileSystem> 33 33 { 34 34 /// <summary> … … 41 41 /// <exception cref="NotSupportedException">Thrown when an unimplemented 42 42 /// file system is requested.</exception> 43 public FileSystem this[VolumeInfo volume]43 public IFileSystem this[VolumeInfo volume] 44 44 { 45 45 get 46 46 { 47 foreach ( FileSystem filesystem in this)47 foreach (IFileSystem filesystem in this) 48 48 if (filesystem.Name.ToUpperInvariant() == 49 49 volume.VolumeFormat.ToUpperInvariant()) -
branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/PrngRegistrar.cs
r2367 r2440 32 32 /// Class managing all the PRNG algorithms. 33 33 /// </summary> 34 public class PrngRegistrar : Registrar< Prng>34 public class PrngRegistrar : Registrar<IPrng> 35 35 { 36 36 /// <summary> … … 46 46 /// <remarks>Client code should set the <see cref="ActivePrngGuid"/> 47 47 /// member.</remarks> 48 public Prng ActivePrng48 public IPrng ActivePrng 49 49 { 50 50 get … … 70 70 { 71 71 lock (this) 72 foreach ( Prng prng in Host.Instance.Prngs)72 foreach (IPrng prng in Host.Instance.Prngs) 73 73 prng.Reseed(entropy); 74 74 } -
branches/eraser6/pluginsRewrite/Eraser/SettingsPanel.cs
r2293 r2440 79 79 //Visually display the other metadata associated with the assembly 80 80 item.ImageIndex = e.Plugin.AssemblyAuthenticode == null ? -1 : 0; 81 item.Group = e.Plugin.LoadingPolicy == LoadingPolicy.Core ?81 item.Group = e.Plugin.LoadingPolicy == PluginLoadingPolicy.Core ? 82 82 pluginsManager.Groups[0] : pluginsManager.Groups[1]; 83 83 item.SubItems.Add(e.Plugin.Assembly.GetFileVersion().ToString()); … … 310 310 ListViewItem item = pluginsManager.Items[e.Index]; 311 311 PluginInfo plugin = (PluginInfo)item.Tag; 312 if (plugin.LoadingPolicy == LoadingPolicy.Core)312 if (plugin.LoadingPolicy == PluginLoadingPolicy.Core) 313 313 e.NewValue = CheckState.Checked; 314 314 } -
branches/eraser6/pluginsRewrite/Eraser/TaskDataSelectionForm.cs
r2058 r2440 29 29 using System.Windows.Forms; 30 30 31 using System.IO; 32 31 33 using Eraser.Manager; 32 34 using Eraser.Util; 33 35 using Eraser.Util.ExtensionMethods; 34 using System.IO;36 using Eraser.Plugins.ExtensionPoints; 35 37 36 38 namespace Eraser … … 40 42 private class ErasureType 41 43 { 42 public ErasureType( ErasureTarget target)44 public ErasureType(IErasureTarget target) 43 45 { 44 46 Target = target; … … 50 52 } 51 53 52 public ErasureTarget Target;54 public IErasureTarget Target; 53 55 54 56 /// <summary> … … 65 67 66 68 //Insert the types of erasure targets 67 foreach ( ErasureTarget target in ManagerLibrary.Instance.ErasureTargetRegistrar)69 foreach (IErasureTarget target in ManagerLibrary.Instance.ErasureTargetRegistrar) 68 70 typeCmb.Items.Add(new ErasureType(target)); 69 71 if (typeCmb.Items.Count != 0) … … 72 74 //And the methods list 73 75 methodCmb.Items.Add(ErasureMethodRegistrar.Default); 74 foreach ( ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar)76 foreach (IErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 75 77 methodCmb.Items.Add(method); 76 78 if (methodCmb.Items.Count != 0) … … 83 85 /// <returns>An Eraser.Manager.Task.Data or Eraser.Manager.Task.UnusedSpace object 84 86 /// or any of its inherited classes, depending on the task selected</returns> 85 public ErasureTarget Target87 public IErasureTarget Target 86 88 { 87 89 get 88 90 { 89 91 ErasureType type = (ErasureType)typeCmb.SelectedItem; 90 ErasureTarget result = type.Target;92 IErasureTarget result = type.Target; 91 93 if (type.Configurer != null) 92 94 type.Configurer.SaveTo(result); 93 result.Method = ( ErasureMethod)methodCmb.SelectedItem;95 result.Method = (IErasureMethod)methodCmb.SelectedItem; 94 96 95 97 return result; … … 99 101 //Set the erasure method. 100 102 foreach (object item in methodCmb.Items) 101 if ((( ErasureMethod)item).Guid == value.Method.Guid)103 if (((IErasureMethod)item).Guid == value.Method.Guid) 102 104 methodCmb.SelectedItem = item; 103 105 … … 149 151 ErasureType type = (ErasureType)typeCmb.SelectedItem; 150 152 if (methodCmb.SelectedItem != ErasureMethodRegistrar.Default && 151 !type.Target.SupportsMethod(( ErasureMethod)methodCmb.SelectedItem))153 !type.Target.SupportsMethod((IErasureMethod)methodCmb.SelectedItem)) 152 154 { 153 155 errorProvider.SetError(methodCmb, S._("The erasure method selected does " +
Note: See TracChangeset
for help on using the changeset viewer.
