Changeset 2440


Ignore:
Timestamp:
03/10/12 13:35:11 (3 years ago)
Author:
lowjoel
Message:

Use the new identifier names defined in Eraser.Plugins.

Location:
branches/eraser6/pluginsRewrite
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/pluginsRewrite/Eraser.BlackBox/Properties/AssemblyInfo.cs

    r2294 r2440  
    2626 
    2727// 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  
    287287 
    288288                //Run the task 
    289                 foreach (ErasureTarget target in task.Targets) 
     289                foreach (IErasureTarget target in task.Targets) 
    290290                    try 
    291291                    { 
  • branches/eraser6/pluginsRewrite/Eraser.Manager/ErasureTargetCollection.cs

    r2365 r2440  
    3939    /// </summary> 
    4040    [Serializable] 
    41     public class ErasureTargetCollection : IList<ErasureTarget>, ISerializable 
     41    public class ErasureTargetCollection : IList<IErasureTarget>, ISerializable 
    4242    { 
    4343        #region Constructors 
    4444        internal ErasureTargetCollection(Task owner) 
    4545        { 
    46             this.list = new List<ErasureTarget>(); 
     46            this.list = new List<IErasureTarget>(); 
    4747            this.owner = owner; 
    4848        } 
     
    5454        } 
    5555 
    56         internal ErasureTargetCollection(Task owner, IEnumerable<ErasureTarget> targets) 
     56        internal ErasureTargetCollection(Task owner, IEnumerable<IErasureTarget> targets) 
    5757            : this(owner) 
    5858        { 
     
    6464        protected ErasureTargetCollection(SerializationInfo info, StreamingContext context) 
    6565        { 
    66             list = (List<ErasureTarget>)info.GetValue("list", typeof(List<ErasureTarget>)); 
     66            list = (List<IErasureTarget>)info.GetValue("list", typeof(List<IErasureTarget>)); 
    6767        } 
    6868 
     
    7575 
    7676        #region IEnumerable<ErasureTarget> Members 
    77         public IEnumerator<ErasureTarget> GetEnumerator() 
     77        public IEnumerator<IErasureTarget> GetEnumerator() 
    7878        { 
    7979            return list.GetEnumerator(); 
     
    8989 
    9090        #region ICollection<ErasureTarget> Members 
    91         public void Add(ErasureTarget item) 
     91        public void Add(IErasureTarget item) 
    9292        { 
    9393            list.Add(item); 
     
    9696        public void Clear() 
    9797        { 
    98             foreach (ErasureTarget item in list) 
     98            foreach (IErasureTarget item in list) 
    9999                Remove(item); 
    100100        } 
    101101 
    102         public bool Contains(ErasureTarget item) 
     102        public bool Contains(IErasureTarget item) 
    103103        { 
    104104            return list.Contains(item); 
    105105        } 
    106106 
    107         public void CopyTo(ErasureTarget[] array, int arrayIndex) 
     107        public void CopyTo(IErasureTarget[] array, int arrayIndex) 
    108108        { 
    109109            list.CopyTo(array, arrayIndex); 
     
    126126        } 
    127127 
    128         public bool Remove(ErasureTarget item) 
     128        public bool Remove(IErasureTarget item) 
    129129        { 
    130130            int index = list.IndexOf(item); 
     
    138138 
    139139        #region IList<ErasureTarget> Members 
    140         public int IndexOf(ErasureTarget item) 
     140        public int IndexOf(IErasureTarget item) 
    141141        { 
    142142            return list.IndexOf(item); 
    143143        } 
    144144 
    145         public void Insert(int index, ErasureTarget item) 
     145        public void Insert(int index, IErasureTarget item) 
    146146        { 
    147147            list.Insert(index, item); 
     
    153153        } 
    154154 
    155         public ErasureTarget this[int index] 
     155        public IErasureTarget this[int index] 
    156156        { 
    157157            get 
     
    184184        /// The list bring the data store behind this object. 
    185185        /// </summary> 
    186         private List<ErasureTarget> list; 
     186        private List<IErasureTarget> list; 
    187187    } 
    188188} 
  • branches/eraser6/pluginsRewrite/Eraser.Manager/ManagerLibrary.cs

    r2378 r2440  
    9595            //There's no approval or denial, what is the specified loading policy? 
    9696            else 
    97                 e.Load = e.Plugin.LoadingPolicy != LoadingPolicy.DefaultOff; 
     97                e.Load = e.Plugin.LoadingPolicy != PluginLoadingPolicy.DefaultOff; 
    9898        } 
    9999 
  • branches/eraser6/pluginsRewrite/Eraser.Manager/Task.cs

    r2406 r2440  
    125125                { 
    126126                    //Simpler case, small set of data. 
    127                     foreach (ErasureTarget tgt in Targets) 
     127                    foreach (IErasureTarget tgt in Targets) 
    128128                        result += S._("{0}, ", tgt.UIText); 
    129129 
     
    272272        /// object. 
    273273        /// </summary> 
    274         /// <param name="sender">The <see cref="ErasureTarget"/> which is reporting 
     274        /// <param name="sender">The <see cref="IErasureTarget"/> which is reporting 
    275275        /// progress.</param> 
    276276        /// <param name="e">The new progress value.</param> 
     
    278278        /// <see cref="TaskProgressEventargs"/></exception> 
    279279        /// <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) 
    281281        { 
    282282            if (sender == null) 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Eraser.Plugins.csproj

    r2438 r2440  
    5454    </Compile> 
    5555    <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" /> 
    6060    <Compile Include="ExtensionPoints\Prng.cs" /> 
    6161    <Compile Include="IConfigurer.cs" /> 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/ErasureMethodRegistrar.cs

    r2358 r2440  
    3838    /// do not have run-time equivalents; they all are compile-time. 
    3939    /// </summary> 
    40     public class ErasureMethodRegistrar : Registrar<ErasureMethod> 
     40    public class ErasureMethodRegistrar : Registrar<IErasureMethod> 
    4141    { 
    4242        #region Default Erasure method 
    43         private class DefaultMethod : ErasureMethod 
     43        private class DefaultMethod : IErasureMethod 
    4444        { 
    4545            public DefaultMethod() 
     
    6868            } 
    6969 
    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) 
    7272            { 
    7373                throw new InvalidOperationException("The DefaultMethod class should never " + 
     
    8282        /// </summary> 
    8383        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] 
    84         public static readonly ErasureMethod Default = new DefaultMethod(); 
     84        public static readonly IErasureMethod Default = new DefaultMethod(); 
    8585        #endregion 
    8686    } 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/ErasureTargetFactoryRegistrar.cs

    r2358 r2440  
    2929namespace Eraser.Plugins.Registrars 
    3030{ 
    31     public class ErasureTargetFactoryRegistrar : FactoryRegistrar<ErasureTarget> 
     31    public class ErasureTargetFactoryRegistrar : FactoryRegistrar<IErasureTarget> 
    3232    { 
    3333    } 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/FileSystemRegistrar.cs

    r2358 r2440  
    3030namespace Eraser.Plugins.Registrars 
    3131{ 
    32     public class FileSystemRegistrar : Registrar<FileSystem> 
     32    public class FileSystemRegistrar : Registrar<IFileSystem> 
    3333    { 
    3434        /// <summary> 
     
    4141        /// <exception cref="NotSupportedException">Thrown when an unimplemented 
    4242        /// file system is requested.</exception> 
    43         public FileSystem this[VolumeInfo volume] 
     43        public IFileSystem this[VolumeInfo volume] 
    4444        { 
    4545            get 
    4646            { 
    47                 foreach (FileSystem filesystem in this) 
     47                foreach (IFileSystem filesystem in this) 
    4848                    if (filesystem.Name.ToUpperInvariant() == 
    4949                        volume.VolumeFormat.ToUpperInvariant()) 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/PrngRegistrar.cs

    r2367 r2440  
    3232    /// Class managing all the PRNG algorithms. 
    3333    /// </summary> 
    34     public class PrngRegistrar : Registrar<Prng> 
     34    public class PrngRegistrar : Registrar<IPrng> 
    3535    { 
    3636        /// <summary> 
     
    4646        /// <remarks>Client code should set the <see cref="ActivePrngGuid"/> 
    4747        /// member.</remarks> 
    48         public Prng ActivePrng 
     48        public IPrng ActivePrng 
    4949        { 
    5050            get 
     
    7070        { 
    7171            lock (this) 
    72                 foreach (Prng prng in Host.Instance.Prngs) 
     72                foreach (IPrng prng in Host.Instance.Prngs) 
    7373                    prng.Reseed(entropy); 
    7474        } 
  • branches/eraser6/pluginsRewrite/Eraser/SettingsPanel.cs

    r2293 r2440  
    7979            //Visually display the other metadata associated with the assembly 
    8080            item.ImageIndex = e.Plugin.AssemblyAuthenticode == null ? -1 : 0; 
    81             item.Group = e.Plugin.LoadingPolicy == LoadingPolicy.Core ? 
     81            item.Group = e.Plugin.LoadingPolicy == PluginLoadingPolicy.Core ? 
    8282                pluginsManager.Groups[0] : pluginsManager.Groups[1]; 
    8383            item.SubItems.Add(e.Plugin.Assembly.GetFileVersion().ToString()); 
     
    310310            ListViewItem item = pluginsManager.Items[e.Index]; 
    311311            PluginInfo plugin = (PluginInfo)item.Tag; 
    312             if (plugin.LoadingPolicy == LoadingPolicy.Core) 
     312            if (plugin.LoadingPolicy == PluginLoadingPolicy.Core) 
    313313                e.NewValue = CheckState.Checked; 
    314314        } 
  • branches/eraser6/pluginsRewrite/Eraser/TaskDataSelectionForm.cs

    r2058 r2440  
    2929using System.Windows.Forms; 
    3030 
     31using System.IO; 
     32 
    3133using Eraser.Manager; 
    3234using Eraser.Util; 
    3335using Eraser.Util.ExtensionMethods; 
    34 using System.IO; 
     36using Eraser.Plugins.ExtensionPoints; 
    3537 
    3638namespace Eraser 
     
    4042        private class ErasureType 
    4143        { 
    42             public ErasureType(ErasureTarget target) 
     44            public ErasureType(IErasureTarget target) 
    4345            { 
    4446                Target = target; 
     
    5052            } 
    5153 
    52             public ErasureTarget Target; 
     54            public IErasureTarget Target; 
    5355 
    5456            /// <summary> 
     
    6567 
    6668            //Insert the types of erasure targets 
    67             foreach (ErasureTarget target in ManagerLibrary.Instance.ErasureTargetRegistrar) 
     69            foreach (IErasureTarget target in ManagerLibrary.Instance.ErasureTargetRegistrar) 
    6870                typeCmb.Items.Add(new ErasureType(target)); 
    6971            if (typeCmb.Items.Count != 0)  
     
    7274            //And the methods list 
    7375            methodCmb.Items.Add(ErasureMethodRegistrar.Default); 
    74             foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
     76            foreach (IErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
    7577                methodCmb.Items.Add(method); 
    7678            if (methodCmb.Items.Count != 0) 
     
    8385        /// <returns>An Eraser.Manager.Task.Data or Eraser.Manager.Task.UnusedSpace object 
    8486        /// or any of its inherited classes, depending on the task selected</returns> 
    85         public ErasureTarget Target 
     87        public IErasureTarget Target 
    8688        { 
    8789            get 
    8890            { 
    8991                ErasureType type = (ErasureType)typeCmb.SelectedItem; 
    90                 ErasureTarget result = type.Target; 
     92                IErasureTarget result = type.Target; 
    9193                if (type.Configurer != null) 
    9294                    type.Configurer.SaveTo(result); 
    93                 result.Method = (ErasureMethod)methodCmb.SelectedItem; 
     95                result.Method = (IErasureMethod)methodCmb.SelectedItem; 
    9496 
    9597                return result; 
     
    99101                //Set the erasure method. 
    100102                foreach (object item in methodCmb.Items) 
    101                     if (((ErasureMethod)item).Guid == value.Method.Guid) 
     103                    if (((IErasureMethod)item).Guid == value.Method.Guid) 
    102104                        methodCmb.SelectedItem = item; 
    103105 
     
    149151            ErasureType type = (ErasureType)typeCmb.SelectedItem; 
    150152            if (methodCmb.SelectedItem != ErasureMethodRegistrar.Default && 
    151                 !type.Target.SupportsMethod((ErasureMethod)methodCmb.SelectedItem)) 
     153                !type.Target.SupportsMethod((IErasureMethod)methodCmb.SelectedItem)) 
    152154            { 
    153155                errorProvider.SetError(methodCmb, S._("The erasure method selected does " + 
Note: See TracChangeset for help on using the changeset viewer.