Changeset 2377
- Timestamp:
- 11/7/2011 12:41:13 PM (19 months ago)
- Location:
- branches/eraser6/pluginsRewrite
- Files:
-
- 2 edited
-
Eraser.DefaultPlugins/Plugin.cs (modified) (1 diff)
-
Eraser.Manager/Settings.cs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/Plugin.cs
r2372 r2377 112 112 113 113 /// <summary> 114 /// The default file erasure method. This is a GUID since methods are 115 /// implemented through plugins and plugins may not be loaded and missing 116 /// references may follow. 117 /// </summary> 118 public Guid DefaultFileErasureMethod 119 { 120 get 121 { 122 //If the user did not define anything for this field, check all plugins 123 //and use the method which was declared by us to be the highest 124 //priority default 125 Guid result = Store.GetValue<Guid>("DefaultFileErasureMethod"); 126 if (result == Guid.Empty) 127 result = new Guid("{1407FC4E-FEFF-4375-B4FB-D7EFBB7E9922}"); 128 129 return result; 130 } 131 set 132 { 133 Store.SetValue("DefaultFileErasureMethod", value); 134 } 135 } 136 137 /// <summary> 138 /// The default unused space erasure method. This is a GUID since methods 139 /// are implemented through plugins and plugins may not be loaded and 140 /// missing references may follow. 141 /// </summary> 142 public Guid DefaultUnusedSpaceErasureMethod 143 { 144 get 145 { 146 Guid result = Store.GetValue<Guid>("DefaultUnusedSpaceErasureMethod"); 147 if (result == Guid.Empty) 148 result = new Guid("{BF8BA267-231A-4085-9BF9-204DE65A6641}"); 149 return result; 150 } 151 set 152 { 153 Store.SetValue("DefaultUnusedSpaceErasureMethod", value); 154 } 155 } 156 157 /// <summary> 158 /// The PRNG used. This is a GUID since PRNGs are implemented through 159 /// plugins and plugins may not be loaded and missing references may follow. 160 /// </summary> 161 public Guid ActivePrng 162 { 163 get 164 { 165 Guid result = Store.GetValue<Guid>("ActivePRNG"); 166 if (result == Guid.Empty) 167 result = new Guid("{6BF35B8E-F37F-476e-B6B2-9994A92C3B0C}"); 168 return result; 169 } 170 set 171 { 172 Store.SetValue("ActivePRNG", value); 173 } 174 } 175 176 /// <summary> 114 177 /// The First/last 16 kilobyte erasure method. 115 178 /// </summary> -
branches/eraser6/pluginsRewrite/Eraser.Manager/Settings.cs
r2376 r2377 41 41 /// Constructor. 42 42 /// </summary> 43 /// <param name="settings">The Settings object which is the data store for 44 /// this object.</param> 45 public ManagerSettings() 43 /// <param name="settings">The Persistent Store for this object.</param> 44 public ManagerSettings(PersistentStore store) 46 45 { 47 settings = ManagerLibrary.Instance.SettingsManager.ModuleSettings; 48 } 49 50 /// <summary> 51 /// The default file erasure method. This is a GUID since methods are 52 /// implemented through plugins and plugins may not be loaded and missing 53 /// references may follow. 54 /// </summary> 55 public Guid DefaultFileErasureMethod 56 { 57 get 58 { 59 //If the user did not define anything for this field, check all plugins 60 //and use the method which was declared by us to be the highest 61 //priority default 62 Guid result = settings.GetValue<Guid>("DefaultFileErasureMethod"); 63 if (result == Guid.Empty) 64 result = FindHighestPriorityDefault(typeof(ErasureMethod), 65 typeof(DefaultFileErasureAttribute)); 66 if (result == Guid.Empty) 67 result = new Guid("{1407FC4E-FEFF-4375-B4FB-D7EFBB7E9922}"); 68 69 return result; 70 } 71 set 72 { 73 settings.SetValue("DefaultFileErasureMethod", value); 74 } 75 } 76 77 /// <summary> 78 /// The default unused space erasure method. This is a GUID since methods 79 /// are implemented through plugins and plugins may not be loaded and 80 /// missing references may follow. 81 /// </summary> 82 public Guid DefaultUnusedSpaceErasureMethod 83 { 84 get 85 { 86 Guid result = settings.GetValue<Guid>("DefaultUnusedSpaceErasureMethod"); 87 if (result == Guid.Empty) 88 result = FindHighestPriorityDefault(typeof(UnusedSpaceErasureMethod), 89 typeof(DefaultUnusedSpaceErasureAttribute)); 90 if (result == Guid.Empty) 91 result = new Guid("{BF8BA267-231A-4085-9BF9-204DE65A6641}"); 92 return result; 93 } 94 set 95 { 96 settings.SetValue("DefaultUnusedSpaceErasureMethod", value); 97 } 98 } 99 100 /// <summary> 101 /// The PRNG used. This is a GUID since PRNGs are implemented through 102 /// plugins and plugins may not be loaded and missing references may follow. 103 /// </summary> 104 public Guid ActivePrng 105 { 106 get 107 { 108 Guid result = settings.GetValue<Guid>("ActivePRNG"); 109 if (result == Guid.Empty) 110 result = FindHighestPriorityDefault(typeof(Prng), typeof(DefaultPrngAttribute)); 111 if (result == Guid.Empty) 112 result = new Guid("{6BF35B8E-F37F-476e-B6B2-9994A92C3B0C}"); 113 return result; 114 } 115 set 116 { 117 settings.SetValue("ActivePRNG", value); 118 } 46 Store = store; 119 47 } 120 48 … … 127 55 get 128 56 { 129 return settings.GetValue("ForceUnlockLockedFiles", true);57 return Store.GetValue("ForceUnlockLockedFiles", true); 130 58 } 131 59 set 132 60 { 133 settings.SetValue("ForceUnlockLockedFiles", value);61 Store.SetValue("ForceUnlockLockedFiles", value); 134 62 } 135 63 } … … 142 70 get 143 71 { 144 return settings.GetValue("ExecuteMissedTasksImmediately", true);72 return Store.GetValue("ExecuteMissedTasksImmediately", true); 145 73 } 146 74 set 147 75 { 148 settings.SetValue("ExecuteMissedTasksImmediately", value);76 Store.SetValue("ExecuteMissedTasksImmediately", value); 149 77 } 150 78 } … … 160 88 get 161 89 { 162 return settings.GetValue("PlausibleDeniability", false);90 return Store.GetValue("PlausibleDeniability", false); 163 91 } 164 92 set 165 93 { 166 settings.SetValue("PlausibleDeniability", value);94 Store.SetValue("PlausibleDeniability", value); 167 95 } 168 96 } … … 175 103 get 176 104 { 177 return new SettingsList<string>(settings, "PlausibleDeniabilityFiles");105 return Store.GetValue("PlausibleDeniabilityFiles", new List<string>()); 178 106 } 179 107 } … … 187 115 get 188 116 { 189 return new SettingsDictionary<Guid, bool>(settings, "ApprovedPlugins");117 return Store.GetValue("ApprovedPlugins", new Dictionary<Guid, bool>()); 190 118 } 191 119 } 192 120 193 121 /// <summary> 194 /// The Settings object which is the data store of this object.122 /// The Persistent Store behind all these settings. 195 123 /// </summary> 196 private Settings settings;124 private PersistentStore Store; 197 125 } 198 126 }
Note: See TracChangeset
for help on using the changeset viewer.
