Ignore:
Timestamp:
3/14/2012 5:45:46 AM (3 years ago)
Author:
lowjoel
Message:

Redesign the Eraser Plugin framework.

  • Split the plugin-dependent interfaces and related support classes out to Eraser.Plugins assembly
    • The extension interfaces are in the Eraser.Plugins.ExtensionPoints? namespace.
      • New IClientTool interface for plugins to create Eraser-hosted tools (e.g. #147)
    • The Registrars are in the Eraser.Plugins.Registrars namespace
    • Base types are now interfaces, no longer abstract base classes
    • Version the Eraser.plugins assembly differently from the rest of the project so that other plugins can target different versions of Eraser with the same assembly. Change the Eraser.Plugins assembly version only if there is an API change.
  • Plugin loading behaviour:
    • Core plugins will be loaded before the rest of the plugins, but they will be loaded only by assembly name and not by path
    • Non-core plugin loading is handled by the Manager Library and not the Plugin code
    • The PluginInstance? class is now the PluginInfo? class
    • There is no longer a need to indicate the default file and unused space erasure methods, PRNGs etc; they are now hardcoded to prevent plugins from changing defaults.
  • The separate command line for the Eraser shell extension has been removed.
    • The Erase on Restart menu item has been removed (since it is a scheduling option and should be set in the Task Properties Dialog)
  • Task Progress information is now pulled from the Eraser core instead of pushed via events.
  • New persistent store class to generalise the use of the old Settings class
  • IDragAndDropConfigurerFactory for transforming drag-and-drop operations to erasure targets. This removes the Eraser.exe assembly's dependency on Eraser.DefaultPlugins?.

Closes #363.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser

  • trunk/eraser/Eraser/TaskDataSelectionForm.cs

    r2058 r2509  
    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; 
     37using Eraser.Plugins.ExtensionPoints; 
     38using Eraser.Plugins.Registrars; 
    3539 
    3640namespace Eraser 
     
    4044        private class ErasureType 
    4145        { 
    42             public ErasureType(ErasureTarget target) 
     46            public ErasureType(IErasureTarget target) 
    4347            { 
    4448                Target = target; 
     
    5054            } 
    5155 
    52             public ErasureTarget Target; 
     56            public IErasureTarget Target; 
    5357 
    5458            /// <summary> 
     
    6569 
    6670            //Insert the types of erasure targets 
    67             foreach (ErasureTarget target in ManagerLibrary.Instance.ErasureTargetRegistrar) 
     71            foreach (IErasureTarget target in Host.Instance.ErasureTargetFactories) 
    6872                typeCmb.Items.Add(new ErasureType(target)); 
    6973            if (typeCmb.Items.Count != 0)  
     
    7276            //And the methods list 
    7377            methodCmb.Items.Add(ErasureMethodRegistrar.Default); 
    74             foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
     78            foreach (IErasureMethod method in Host.Instance.ErasureMethods) 
    7579                methodCmb.Items.Add(method); 
    7680            if (methodCmb.Items.Count != 0) 
     
    8387        /// <returns>An Eraser.Manager.Task.Data or Eraser.Manager.Task.UnusedSpace object 
    8488        /// or any of its inherited classes, depending on the task selected</returns> 
    85         public ErasureTarget Target 
     89        public IErasureTarget Target 
    8690        { 
    8791            get 
    8892            { 
    8993                ErasureType type = (ErasureType)typeCmb.SelectedItem; 
    90                 ErasureTarget result = type.Target; 
     94                IErasureTarget result = type.Target; 
    9195                if (type.Configurer != null) 
    9296                    type.Configurer.SaveTo(result); 
    93                 result.Method = (ErasureMethod)methodCmb.SelectedItem; 
     97                result.Method = (IErasureMethod)methodCmb.SelectedItem; 
    9498 
    9599                return result; 
     
    99103                //Set the erasure method. 
    100104                foreach (object item in methodCmb.Items) 
    101                     if (((ErasureMethod)item).Guid == value.Method.Guid) 
     105                    if (((IErasureMethod)item).Guid == value.Method.Guid) 
    102106                        methodCmb.SelectedItem = item; 
    103107 
     
    149153            ErasureType type = (ErasureType)typeCmb.SelectedItem; 
    150154            if (methodCmb.SelectedItem != ErasureMethodRegistrar.Default && 
    151                 !type.Target.SupportsMethod((ErasureMethod)methodCmb.SelectedItem)) 
     155                !type.Target.SupportsMethod((IErasureMethod)methodCmb.SelectedItem)) 
    152156            { 
    153157                errorProvider.SetError(methodCmb, S._("The erasure method selected does " + 
Note: See TracChangeset for help on using the changeset viewer.