source: branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/Plugin.cs @ 2372

Revision 2372, 4.2 KB checked in by lowjoel, 3 years ago (diff)

Use the new Host.Initialize prototype.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1/*
2 * $Id$
3 * Copyright 2008-2010 The Eraser Project
4 * Original Author: Joel Low <lowjoel@users.sourceforge.net>
5 * Modified By:
6 *
7 * This file is part of Eraser.
8 *
9 * Eraser is free software: you can redistribute it and/or modify it under the
10 * terms of the GNU General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option) any later
12 * version.
13 *
14 * Eraser is distributed in the hope that it will be useful, but WITHOUT ANY
15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 *
18 * A copy of the GNU General Public License can be found at
19 * <http://www.gnu.org/licenses/>.
20 */
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25using System.Windows.Forms;
26
27using Eraser.Plugins;
28using Eraser.Util;
29
30namespace Eraser.DefaultPlugins
31{
32    public sealed class DefaultPlugin : IPlugin
33    {
34        public void Initialize(PluginInfo info)
35        {
36            Settings = new DefaultPluginSettings(info.PersistentStore);
37
38            //Then register the erasure methods et al.
39            Host.Instance.ErasureMethods.Add(new Gutmann());            //35 passes
40            Host.Instance.ErasureMethods.Add(new DoD_EcE());            //7 passes
41            Host.Instance.ErasureMethods.Add(new RCMP_TSSIT_OPS_II());  //7 passes
42            Host.Instance.ErasureMethods.Add(new Schneier());           //7 passes
43            Host.Instance.ErasureMethods.Add(new VSITR());              //7 passes
44            Host.Instance.ErasureMethods.Add(new DoD_E());              //3 passes
45            Host.Instance.ErasureMethods.Add(new HMGIS5Enhanced());     //3 passes
46            Host.Instance.ErasureMethods.Add(new USAF5020());           //3 passes
47            Host.Instance.ErasureMethods.Add(new USArmyAR380_19());     //3 passes
48            Host.Instance.ErasureMethods.Add(new GOSTP50739());         //2 passes
49            Host.Instance.ErasureMethods.Add(new HMGIS5Baseline());     //1 pass
50            Host.Instance.ErasureMethods.Add(new Pseudorandom());       //1 pass
51            EraseCustom.RegisterAll();
52            Host.Instance.ErasureMethods.Add(new FirstLast16KB());
53
54            Host.Instance.Prngs.Add(new RngCrypto());
55
56            Host.Instance.EntropySources.Add(new KernelEntropySource());
57
58            Host.Instance.FileSystems.Add(new Fat12FileSystem());
59            Host.Instance.FileSystems.Add(new Fat16FileSystem());
60            Host.Instance.FileSystems.Add(new Fat32FileSystem());
61            Host.Instance.FileSystems.Add(new NtfsFileSystem());
62
63            Host.Instance.ErasureTargetFactories.Add(new FileErasureTarget());
64            Host.Instance.ErasureTargetFactories.Add(new FolderErasureTarget());
65            Host.Instance.ErasureTargetFactories.Add(new RecycleBinErasureTarget());
66            Host.Instance.ErasureTargetFactories.Add(new UnusedSpaceErasureTarget());
67            Host.Instance.ErasureTargetFactories.Add(new SecureMoveErasureTarget());
68            Host.Instance.ErasureTargetFactories.Add(new DriveErasureTarget());
69        }
70
71        public void Dispose()
72        {
73            GC.SuppressFinalize(this);
74        }
75
76        public string Name
77        {
78            get { return S._("Default Erasure Methods and PRNGs"); }
79        }
80
81        public string Author
82        {
83            get { return S._("The Eraser Project <eraser-development@lists.sourceforge.net>"); }
84        }
85
86        public bool Configurable
87        {
88            get { return true; }
89        }
90
91        public void DisplaySettings(Control parent)
92        {
93            SettingsForm form = new SettingsForm();
94            form.ShowDialog();
95        }
96
97        /// <summary>
98        /// The dictionary holding settings for this plugin.
99        /// </summary>
100        internal static DefaultPluginSettings Settings;
101    }
102
103    /// <summary>
104    /// A concrete class to manage the settings for this plugin.
105    /// </summary>
106    internal class DefaultPluginSettings
107    {
108        public DefaultPluginSettings(PersistentStore store)
109        {
110            Store = store;
111        }
112
113        /// <summary>
114        /// The First/last 16 kilobyte erasure method.
115        /// </summary>
116        public Guid FL16Method
117        {
118            get
119            {
120                return Store.GetValue<Guid>("FL16Method");
121            }
122            set
123            {
124                Store.SetValue("FL16Method", value);
125            }
126        }
127
128        /// <summary>
129        /// The set of custom erasure methods.
130        /// </summary>
131        public Dictionary<Guid, CustomErasureMethod> EraseCustom
132        {
133            get
134            {
135                return Store.GetValue<Dictionary<Guid, CustomErasureMethod>>("EraseCustom");
136            }
137            set
138            {
139                Store.SetValue("EraseCustom", value);
140            }
141        }
142
143        /// <summary>
144        /// The data store for our settings.
145        /// </summary>
146        PersistentStore Store;
147    }
148}
Note: See TracBrowser for help on using the repository browser.