Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 3075 was 3072, checked in by gkronber, 15 years ago

Copied projects related to the deployment service from the feature branch. #918 (Integrate deployment service into trunk and HL3.3 solution file)

File size: 2.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Runtime.Serialization;
6
7namespace HeuristicLab.Services.Deployment {
8  [DataContract(Name = "PluginDescription")]
9  public class PluginDescription {
10
11    [DataMember(Name = "Name")]
12    private string name;
13    public string Name {
14      get { return name; }
15    }
16
17    [DataMember(Name = "Version")]
18    private Version version;
19    public Version Version {
20      get { return version; }
21    }
22
23    [DataMember(Name = "ContactName")]
24    private string contactName;
25    public string ContactName {
26      get { return contactName; }
27    }
28
29    [DataMember(Name = "ContactEmail")]
30    private string contactEmail;
31    public string ContactEmail {
32      get { return contactEmail; }
33    }
34
35    [DataMember(Name = "LicenseText")]
36    private string licenseText;
37    public string LicenseText {
38      get { return licenseText; }
39    }
40
41    [DataMember(Name = "Dependencies")]
42    private List<PluginDescription> dependencies;
43    public List<PluginDescription> Dependencies {
44      get { return dependencies; }
45    }
46
47    public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies,
48      string contactName, string contactEmail, string license) {
49      if (string.IsNullOrEmpty(name)) throw new ArgumentException("name is empty");
50      if (version == null || dependencies == null ||
51        contactName == null || contactEmail == null ||
52        license == null) throw new ArgumentNullException();
53      this.name = name;
54      this.version = version;
55      this.dependencies = new List<PluginDescription>(dependencies);
56      this.licenseText = license;
57      this.contactName = contactName;
58      this.contactEmail = contactEmail;
59    }
60
61    public PluginDescription(string name, Version version)
62      : this(name, version, Enumerable.Empty<PluginDescription>()) {
63    }
64
65    public PluginDescription(string name, Version version, IEnumerable<PluginDescription> dependencies)
66      : this(name, version, dependencies, string.Empty, string.Empty, string.Empty) {
67    }
68  }
69}
Note: See TracBrowser for help on using the repository browser.