Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/10 12:20:43 (15 years ago)
Author:
gkronber
Message:

Prepared plugin infrastructure to work with versioned plugins and dependencies and added versioning to part of HL.GP plugins. #864 (Plugins should have an a version)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/Attributes/PluginAttribute.cs

    r2748 r2750  
    4747    }
    4848
     49    private Version version;
     50    /// <summary>
     51    /// Gets the version of the plugin.
     52    /// </summary>
     53    public Version Version {
     54      get { return version; }
     55    }
     56
     57    [Obsolete]
     58    public PluginAttribute(string name) : this(name, "0.0.0.0") { }
     59
    4960    /// <summary>
    5061    /// Initializes a new instance of <see cref="PluginAttribute"/>.
    5162    /// <param name="name">Name of the plugin</param>
     63    /// <param name="version">Version of the plugin</param>
    5264    /// </summary>
    53     public PluginAttribute(string name)
    54       : this(name, string.Empty) {
     65    public PluginAttribute(string name, string version)
     66      : this(name, string.Empty, version) {
    5567    }
    5668
    5769    /// <summary>
    5870    /// Initializes a new instance of <see cref="PluginAttribute"/>.
     71    /// </summary>
    5972    /// <param name="name">Name of the plugin</param>
    6073    /// <param name="description">Description of the plugin</param>
    61     /// </summary>
    62     public PluginAttribute(string name, string description) {
     74    /// <param name="version">Version of the plugin</param>
     75    public PluginAttribute(string name, string description, string version) {
    6376      if (string.IsNullOrEmpty(name)) throw new ArgumentException("Plugin name is null or empty.");
    6477      if (description == null) throw new ArgumentNullException("description");
     78      if (string.IsNullOrEmpty(version)) new ArgumentException("Version string is null or empty.");
    6579      this.name = name;
    6680      this.description = description;
     81      this.version = new Version(version); // throws format exception if the version string can't be parsed
    6782    }
    6883  }
Note: See TracChangeset for help on using the changeset viewer.