1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Runtime.Serialization;
|
---|
6 |
|
---|
7 | namespace 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 | }
|
---|