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

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

First batch of changes for Eraser.DefaultPlugins?. There are plenty of build errors in this one, but let's solve them one at a time.

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