source: trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/RecycleBinErasureTargetConfigurer.cs @ 2232

Revision 2232, 1.7 KB checked in by lowjoel, 4 years ago (diff)

Make the generation of help text for addtask parameters done by the plugins, since the arguments are passed to them, they should document their own CLIs. To do this, the ICliConfigurer interface was modified.

  • 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;
26using System.Text.RegularExpressions;
27
28using Eraser.Manager;
29using Eraser.Util;
30
31namespace Eraser.DefaultPlugins
32{
33    class RecycleBinErasureTargetConfigurer : IErasureTargetConfigurer
34    {
35        #region IConfigurer<ErasureTarget> Members
36
37        public void LoadFrom(ErasureTarget target)
38        {
39        }
40
41        public bool SaveTo(ErasureTarget target)
42        {
43            return true;
44        }
45
46        #endregion
47
48        #region ICliConfigurer<ErasureTarget> Members
49
50        public string Help()
51        {
52            return S._("recyclebin          Erases files and folders in the recycle bin");
53        }
54
55        public bool ProcessArgument(string argument)
56        {
57            Regex regex = new Regex("(?<recycleBin>recyclebin)",
58                RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.RightToLeft);
59            Match match = regex.Match(argument);
60
61            if (match.Groups["recycleBin"].Success)
62            {
63                return true;
64            }
65
66            return false;
67        }
68
69        #endregion
70    }
71}
Note: See TracBrowser for help on using the repository browser.