Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Services.Deployment/3.3/PluginDescription.cs @ 4682

Last change on this file since 4682 was 3217, checked in by gkronber, 15 years ago

Defined PluginDescription data contract as IsReference and changed caching scheme of plugin descriptions in the plugin store to use the plugin id as key. #951 (Refreshing the list of plugins and products of the deployment service is very slow)

File size: 3.7 KB
RevLine 
[3084]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 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;
[2804]23using System.Collections.Generic;
24using System.Linq;
25using System.Text;
26using System.Runtime.Serialization;
27
28namespace HeuristicLab.Services.Deployment {
[3217]29  [DataContract(Name = "PluginDescription", IsReference = true)]
[2816]30  public class PluginDescription {
[2804]31
32    [DataMember(Name = "Name")]
33    private string name;
34    public string Name {
35      get { return name; }
[3217]36      set {
37        if (string.IsNullOrEmpty(value)) throw new ArgumentException();
38        name = value;
39      }
[2804]40    }
41
42    [DataMember(Name = "Version")]
43    private Version version;
44    public Version Version {
45      get { return version; }
[3217]46      set {
47        if (value == null) throw new ArgumentNullException();
48        version = value;
49      }
[2804]50    }
51
[2860]52    [DataMember(Name = "ContactName")]
53    private string contactName;
54    public string ContactName {
55      get { return contactName; }
[3217]56      set {
57        if (value == null) throw new ArgumentNullException();
58        contactName = value;
59      }
[2816]60    }
[2804]61
[2860]62    [DataMember(Name = "ContactEmail")]
63    private string contactEmail;
64    public string ContactEmail {
65      get { return contactEmail; }
[3217]66      set {
67        if (value == null) throw new ArgumentNullException();
68        contactEmail = value;
69      }
[2860]70    }
71
[2816]72    [DataMember(Name = "LicenseText")]
73    private string licenseText;
74    public string LicenseText {
75      get { return licenseText; }
[3217]76      set {
77        if (value == null) throw new ArgumentNullException();
78        licenseText = value;
79      }
[2816]80    }
81
[2804]82    [DataMember(Name = "Dependencies")]
83    private List<PluginDescription> dependencies;
84    public List<PluginDescription> Dependencies {
85      get { return dependencies; }
[3217]86      set {
87        if (value == null) throw new ArgumentNullException();
88        dependencies = value;
89      }
[2804]90    }
91
[3217]92    public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies,
[2860]93      string contactName, string contactEmail, string license) {
[2816]94      if (string.IsNullOrEmpty(name)) throw new ArgumentException("name is empty");
[2860]95      if (version == null || dependencies == null ||
96        contactName == null || contactEmail == null ||
97        license == null) throw new ArgumentNullException();
[2804]98      this.name = name;
99      this.version = version;
[2816]100      this.dependencies = new List<PluginDescription>(dependencies);
101      this.licenseText = license;
[2860]102      this.contactName = contactName;
103      this.contactEmail = contactEmail;
[2804]104    }
105
106    public PluginDescription(string name, Version version)
107      : this(name, version, Enumerable.Empty<PluginDescription>()) {
108    }
[2816]109
110    public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies)
[2860]111      : this(name, version, dependencies, string.Empty, string.Empty, string.Empty) {
[2816]112    }
[2804]113  }
114}
Note: See TracBrowser for help on using the repository browser.