Changeset 486 for branches/eraser6/Manager/Task.cs
- Timestamp:
- 11/10/2008 9:03:31 AM (5 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Manager/Task.cs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Manager/Task.cs
r485 r486 72 72 /// task type. 73 73 /// </summary> 74 public ErasureMethod Method 75 { 76 get { return method; } 77 set { method = value; } 74 public abstract ErasureMethod Method 75 { 76 get; 77 set; 78 } 79 80 /// <summary> 81 /// Checks whether a method has been selected for this target. This is 82 /// because the Method property will return non-default erasure methods 83 /// only. 84 /// </summary> 85 public bool MethodDefined 86 { 87 get 88 { 89 return method != ErasureMethodManager.Default; 90 } 78 91 } 79 92 … … 86 99 } 87 100 88 private ErasureMethod method = null; 101 /// <summary> 102 /// Retrieves the amount of data that needs to be written in order to 103 /// complete the erasure. 104 /// </summary> 105 public abstract long TotalData 106 { 107 get; 108 } 109 110 protected ErasureMethod method = null; 89 111 } 90 112 … … 154 176 } 155 177 178 public override ErasureMethod Method 179 { 180 get 181 { 182 if (method != ErasureMethodManager.Default) 183 return method; 184 return ErasureMethodManager.GetInstance( 185 ManagerLibrary.Instance.Settings.DefaultFileErasureMethod); 186 } 187 set 188 { 189 method = value; 190 } 191 } 192 156 193 public override string UIText 157 194 { 158 195 get { return Path; } 196 } 197 198 public override long TotalData 199 { 200 get 201 { 202 long totalSize = 0; 203 List<string> paths = GetPaths(out totalSize); 204 return Method.CalculateEraseDataSize(paths, totalSize); 205 } 159 206 } 160 207 … … 192 239 } 193 240 241 public override ErasureMethod Method 242 { 243 get 244 { 245 if (method != ErasureMethodManager.Default) 246 return method; 247 return ErasureMethodManager.GetInstance( 248 ManagerLibrary.Instance.Settings.DefaultUnusedSpaceErasureMethod); 249 } 250 set 251 { 252 method = value; 253 } 254 } 255 194 256 public override string UIText 195 257 { 196 258 get { return string.Format("Unused disk space ({0})", Drive); } 259 } 260 261 public override long TotalData 262 { 263 get 264 { 265 VolumeInfo info = VolumeInfo.FromMountpoint(Drive); 266 return Method.CalculateEraseDataSize(null, info.AvailableFreeSpace); 267 } 197 268 } 198 269 … … 683 754 public TimeSpan TimeLeft 684 755 { 685 get { return new TimeSpan(timeLeft * 10000000L); }756 get { return timeLeft; } 686 757 } 687 758 … … 746 817 747 818 private float overallProgress = 0.0f; 748 internal int timeLeft = -1;819 internal TimeSpan timeLeft = new TimeSpan(0, 0, -1); 749 820 750 821 internal Task.ErasureTarget currentTarget;
Note: See TracChangeset
for help on using the changeset viewer.
