#region License Information /* HeuristicLab * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Linq; namespace HeuristicLab.PluginInfrastructure.Advanced.DeploymentService { // extension of auto-generated DataContract class PluginDescription public partial class PluginDescription : IPluginDescription { /// /// Initializes an new instance of /// with no dependencies, empty contact details and empty license text. /// /// Name of the plugin /// Version of the plugin public PluginDescription(string name, Version version) : this(name, version, new List()) { } /// /// Initializes a new instance of /// with empty contact details and empty license text. /// /// Name of the plugin /// Version of the plugin /// Enumerable of dependencies of the plugin public PluginDescription(string name, Version version, IEnumerable dependencies) : this(name, version, dependencies, string.Empty, string.Empty, string.Empty) { } /// /// Initializes a new instance of . /// /// Name of the plugin /// Version of the plugin /// Enumerable of dependencies of the plugin /// Name of the contact person for the plugin /// E-mail of the contact person for the plugin /// License text for the plugin public PluginDescription(string name, Version version, IEnumerable dependencies, string contactName, string contactEmail, string licenseText) { this.Name = name; this.Version = version; this.Dependencies = dependencies.ToArray(); this.LicenseText = licenseText; } #region IPluginDescription Members /// /// Gets the description of the plugin. Always string.Empty. /// public string Description { get { return string.Empty; } } /// /// Gets an enumerable of dependencies of the plugin /// IEnumerable IPluginDescription.Dependencies { get { return Dependencies; } } /// /// Gets and enumerable of files that are part of this pluing. Always empty. /// public IEnumerable Files { get { return Enumerable.Empty(); } } #endregion /// /// ToString override /// /// String representation of the PluginDescription (name + version) public override string ToString() { return Name + " " + Version; } public override bool Equals(object obj) { PluginDescription other = obj as PluginDescription; if (other == null) return false; else return other.Name == this.Name && other.Version == this.Version; } public override int GetHashCode() { return Name.GetHashCode() + Version.GetHashCode(); } } }