Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Attributes/PluginFileAttribute.cs @ 2475

Last change on this file since 2475 was 2475, checked in by gkronber, 14 years ago

worked on plugin infrastructure refactoring. #799

File size: 2.3 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25
26namespace HeuristicLab.PluginInfrastructure {
27  /// <summary>
28  /// Enumerator of available file types for a plugin.
29  /// </summary>
30  public enum PluginFileType {
31    Assembly,
32    Executable,
33    Data,
34    License
35  };
36
37  /// <summary>
38  /// PluginFileAttribute can be used to declare which files make up an plugin.
39  /// Multiple files can be associated to an plugin. Each file should be associated to only one plugin.
40  /// </summary>
41  [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
42  public class PluginFileAttribute : System.Attribute {
43    private string filename;
44
45    /// <summary>
46    /// Gets or sets the filename of the plugin.
47    /// </summary>
48    public string Filename {
49      get { return filename; }
50      set { filename = value; }
51    }
52
53    private PluginFileType filetype = PluginFileType.Data;
54
55    /// <summary>
56    /// Gets or sets the filetype of the plugin file.
57    /// </summary>
58    public PluginFileType Filetype {
59      get { return filetype; }
60      set { filetype = value; }
61    }
62
63    /// <summary>
64    /// Initializes a new instance of <see cref="PluginFileAttribute"/>.
65    /// <param name="filename">Name of the file</param>
66    /// <param name="type">Type of the file (Assembly, Executable, Data, License)</param>
67    /// </summary>
68    public PluginFileAttribute(string filename, PluginFileType type) {
69      this.filename = filename;
70      this.filetype = type;
71    }
72  }
73}
Note: See TracBrowser for help on using the repository browser.