Changeset 2439


Ignore:
Timestamp:
3/10/2012 1:32:51 PM (3 years ago)
Author:
lowjoel
Message:

Make all the plugin extension points interfaces. I'll move the rest of the code tomorrow.

Location:
branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints
Files:
5 moved

Legend:

Unmodified
Added
Removed
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/IEntropySource.cs

    r2405 r2439  
    3232    /// the EntropyPoller class. 
    3333    /// </summary> 
    34     public abstract class EntropySource : IRegisterable 
     34    public interface IEntropySource : IRegisterable 
    3535    { 
    3636        /// <summary> 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/IErasureMethod.cs

    r2405 r2439  
    3535    /// streams, not unused drive space. 
    3636    /// </summary> 
    37     public abstract class ErasureMethod : IRegisterable 
     37    public abstract class IErasureMethod : IRegisterable 
    3838    { 
    3939        public override string ToString() 
     
    100100        /// <param name="prng">The PRNG source for random data.</param> 
    101101        /// <param name="callback">The progress callback function.</param> 
    102         public abstract void Erase(Stream stream, long erasureLength, Prng prng, 
     102        public abstract void Erase(Stream stream, long erasureLength, IPrng prng, 
    103103            ErasureMethodProgressFunction callback); 
    104104 
     
    128128 
    129129            //Randomize. 
    130             Prng rand = Host.Instance.Prngs.ActivePrng; 
     130            IPrng rand = Host.Instance.Prngs.ActivePrng; 
    131131            for (int i = 0; i < result.Length; ++i) 
    132132            { 
     
    148148        public static void WriteRandom(byte[] buffer, object value) 
    149149        { 
    150             ((Prng)value).NextBytes(buffer); 
     150            ((IPrng)value).NextBytes(buffer); 
    151151        } 
    152152 
     
    182182    /// unused drive space. 
    183183    /// </summary> 
    184     public abstract class UnusedSpaceErasureMethod : ErasureMethod 
     184    public abstract class UnusedSpaceErasureMethod : IErasureMethod 
    185185    { 
    186186        /// <summary> 
     
    197197        /// <param name="prng">The PRNG source for random data.</param> 
    198198        /// <param name="callback">The progress callback function.</param> 
    199         public virtual void EraseUnusedSpace(Stream stream, Prng prng, ErasureMethodProgressFunction callback) 
     199        public virtual void EraseUnusedSpace(Stream stream, IPrng prng, ErasureMethodProgressFunction callback) 
    200200        { 
    201201            Erase(stream, long.MaxValue, prng, callback); 
     
    242242        } 
    243243 
    244         public override void Erase(Stream stream, long erasureLength, Prng prng, 
     244        public override void Erase(Stream stream, long erasureLength, IPrng prng, 
    245245            ErasureMethodProgressFunction callback) 
    246246        { 
     
    324324        /// <param name="buffer">The buffer to populate with the data to write.</param> 
    325325        /// <param name="prng">The PRNG used for random passes.</param> 
    326         public void Execute(byte[] buffer, Prng prng) 
     326        public void Execute(byte[] buffer, IPrng prng) 
    327327        { 
    328328            Function(buffer, OpaqueValue == null ? prng : OpaqueValue); 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/IErasureTarget.cs

    r2405 r2439  
    3737    /// </summary> 
    3838    [Serializable] 
    39     public abstract class ErasureTarget : ISerializable, IRegisterable 
     39    public abstract class IErasureTarget : ISerializable, IRegisterable 
    4040    { 
    4141        #region Serialization code 
    42         protected ErasureTarget(SerializationInfo info, StreamingContext context) 
     42        protected IErasureTarget(SerializationInfo info, StreamingContext context) 
    4343        { 
    4444            Guid methodGuid = (Guid)info.GetValue("Method", typeof(Guid)); 
     
    6868        /// Constructor. 
    6969        /// </summary> 
    70         protected ErasureTarget() 
     70        protected IErasureTarget() 
    7171        { 
    7272            Method = ErasureMethodRegistrar.Default; 
     
    8484        /// The method used for erasing the file. 
    8585        /// </summary> 
    86         public ErasureMethod Method 
     86        public IErasureMethod Method 
    8787        { 
    8888            get 
     
    106106        /// <returns>The Erasure method which the target should be erased with. 
    107107        /// This function will never return <see cref="ErasureMethodRegistrar.Default"/></returns> 
    108         public virtual ErasureMethod EffectiveMethod 
     108        public virtual IErasureMethod EffectiveMethod 
    109109        { 
    110110            get 
     
    124124        /// <param name="method">The erasure method to check.</param> 
    125125        /// <returns>True if the erasure method is supported, false otherwise.</returns> 
    126         public virtual bool SupportsMethod(ErasureMethod method) 
     126        public virtual bool SupportsMethod(IErasureMethod method) 
    127127        { 
    128128            return true; 
     
    140140        /// The Progress Changed event handler of the owning task. 
    141141        /// </summary> 
    142         protected internal Action<ErasureTarget, ProgressChangedEventArgs> OnProgressChanged 
     142        protected internal Action<IErasureTarget, ProgressChangedEventArgs> OnProgressChanged 
    143143        { 
    144144            get; 
     
    166166        /// The backing variable for the <see cref="Method"/> property. 
    167167        /// </summary> 
    168         private ErasureMethod method; 
     168        private IErasureMethod method; 
    169169    } 
    170170 
     
    173173    /// object. 
    174174    /// </summary> 
    175     public interface IErasureTargetConfigurer : ICliConfigurer<ErasureTarget> 
     175    public interface IErasureTargetConfigurer : ICliConfigurer<IErasureTarget> 
    176176    { 
    177177    } 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/IFileSystem.cs

    r2405 r2439  
    3434    /// Provides functions to handle erasures specfic to file systems. 
    3535    /// </summary> 
    36     public abstract class FileSystem : IRegisterable 
     36    public abstract class IFileSystem : IRegisterable 
    3737    { 
    3838        /// <summary> 
     
    4747        { 
    4848            //Get the PRNG we are going to use 
    49             Prng prng = Host.Instance.Prngs.ActivePrng; 
     49            IPrng prng = Host.Instance.Prngs.ActivePrng; 
    5050 
    5151            //Initialsie the base name, if any. 
     
    110110 
    111111            //Find a random entry. 
    112             Prng prng = Host.Instance.Prngs.ActivePrng; 
     112            IPrng prng = Host.Instance.Prngs.ActivePrng; 
    113113            string result = string.Empty; 
    114114            while (result.Length == 0) 
     
    205205        /// <param name="searchCallback">The callback function for search progress.</param> 
    206206        /// <param name="eraseCallback">The callback function for erasure progress.</param> 
    207         public abstract void EraseClusterTips(VolumeInfo info, ErasureMethod method, 
     207        public abstract void EraseClusterTips(VolumeInfo info, IErasureMethod method, 
    208208            ClusterTipsSearchProgress searchCallback, ClusterTipsEraseProgress eraseCallback); 
    209209 
     
    220220        /// <param name="method">The method used to erase the files.</param> 
    221221        public abstract void EraseOldFileSystemResidentFiles(VolumeInfo volume, 
    222             DirectoryInfo tempDirectory, ErasureMethod method, 
     222            DirectoryInfo tempDirectory, IErasureMethod method, 
    223223            FileSystemEntriesEraseProgress callback); 
    224224 
     
    241241        /// </summary> 
    242242        /// <param name="info"></param> 
    243         public abstract void EraseFileSystemObject(StreamInfo info, ErasureMethod method, 
    244             ErasureMethod.ErasureMethodProgressFunction callback); 
     243        public abstract void EraseFileSystemObject(StreamInfo info, IErasureMethod method, 
     244            IErasureMethod.ErasureMethodProgressFunction callback); 
    245245 
    246246        //TODO: This is supposed to be in VolumeInfo! 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/IPrng.cs

    r2405 r2439  
    3131    /// random data erase passes. 
    3232    /// </summary> 
    33     public abstract class Prng : IRegisterable 
     33    public abstract class IPrng : IRegisterable 
    3434    { 
    3535        public override string ToString() 
Note: See TracChangeset for help on using the changeset viewer.