source: branches/eraser6/pluginsRewrite/Eraser.DefaultPlugins/ErasureTargets/FileErasureTarget.cs @ 2368

Revision 2368, 2.2 KB checked in by lowjoel, 2 years ago (diff)

Replace the reference to Eraser.Manager with Eraser.Plugins. The majority of compile errors have been fixed already.

  • 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.Linq;
25using System.Text;
26
27using System.Runtime.Serialization;
28using System.Runtime.InteropServices;
29using System.IO;
30
31using Eraser.Util;
32using Eraser.Plugins.ExtensionPoints;
33
34namespace Eraser.DefaultPlugins
35{
36    /// <summary>
37    /// Class representing a file to be erased.
38    /// </summary>
39    [Serializable]
40    [Guid("0D741505-E1C4-400d-8470-598AF35E174D")]
41    public class FileErasureTarget : FileSystemObjectErasureTarget
42    {
43        #region Serialization code
44        protected FileErasureTarget(SerializationInfo info, StreamingContext context)
45            : base(info, context)
46        {
47        }
48        #endregion
49
50        /// <summary>
51        /// Constructor.
52        /// </summary>
53        public FileErasureTarget()
54        {
55        }
56
57        public override Guid Guid
58        {
59            get { return GetType().GUID; }
60        }
61
62        public override string Name
63        {
64            get { return S._("File"); }
65        }
66
67        public override IErasureTargetConfigurer Configurer
68        {
69            get { return new FileErasureTargetConfigurer(); }
70        }
71
72        protected override List<StreamInfo> GetPaths()
73        {
74            List<StreamInfo> result = new List<StreamInfo>();
75            FileInfo fileInfo = new FileInfo(Path);
76
77            if (fileInfo.Exists)
78            {
79                result.AddRange(GetPathADSes(fileInfo));
80                result.Add(new StreamInfo(Path));
81            }
82
83            return result;
84        }
85
86        public override void Execute()
87        {
88            Progress = new SteppedProgressManager();
89
90            try
91            {
92                base.Execute();
93            }
94            finally
95            {
96                Progress = null;
97            }
98        }
99    }
100}
Note: See TracBrowser for help on using the repository browser.