Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/08 15:59:07 (16 years ago)
Author:
gkronber
Message:
  • added an attribute for the build time of an assembly.
  • build-date is automatically updated via SubWCRev in the pre-build action.
  • adapted PluginManager to correctly handle plugins with same version but newer build date

fixes ticket #39

Location:
trunk/sources/HeuristicLab.PluginInfrastructure
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/ClassInfoAttribute.cs

    r2 r91  
    3232  public class ClassInfoAttribute : System.Attribute {
    3333    private string name;
    34 
    3534    /// <summary>
    3635    /// Name of the plugin to which the assembly belongs to.
     
    4241
    4342    private string version;
    44 
    4543    public string Version {
    4644      get { return version; }
     
    4846    }
    4947
    50 
    5148    private string description;
    52 
    5349    public string Description {
    5450      get { return description; }
  • trunk/sources/HeuristicLab.PluginInfrastructure/HeuristicLab.PluginInfrastructure.csproj

    r30 r91  
    4949  <ItemGroup>
    5050    <Compile Include="ApplicationInfo.cs" />
     51    <Compile Include="AssemblyBuildDateAttribute.cs" />
    5152    <Compile Include="BaseClasses\ApplicationBase.cs" />
    5253    <Compile Include="BaseClasses\PluginBase.cs" />
  • trunk/sources/HeuristicLab.PluginInfrastructure/Loader.cs

    r37 r91  
    333333      pluginInfo.Name = plugin.Name;
    334334      pluginInfo.Version = plugin.Version;
     335
     336      object[] customAttributes = plugin.GetType().Assembly.GetCustomAttributes(typeof(AssemblyBuildDateAttribute), false);
     337      if(customAttributes.Length > 0) {
     338        pluginInfo.BuildDate = ((AssemblyBuildDateAttribute)customAttributes[0]).BuildDate;
     339      }
     340
    335341      string baseDir = AppDomain.CurrentDomain.BaseDirectory;
    336342
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginInfo.cs

    r37 r91  
    3232  public class PluginInfo {
    3333    private string name;
    34 
    3534    public string Name {
    3635      get { return name; }
    3736      set { name = value; }
    3837    }
    39 
    4038    private Version version;
    41 
    4239    public Version Version {
    4340      get { return version; }
    4441      set { version = value; }
    4542    }
    46 
    47     private List<string> files = new List<string> ();
     43    private DateTime buildDate;
     44    public DateTime BuildDate {
     45      get { return buildDate; }
     46      set { buildDate = value; }
     47    }
     48    private List<string> files = new List<string>();
    4849    /// <summary>
    4950    /// Names of all files that belong to this plugin.
     
    5455    }
    5556
    56     private List<PluginInfo> dependencies = new List<PluginInfo> ();
     57    private List<PluginInfo> dependencies = new List<PluginInfo>();
    5758    public List<PluginInfo> Dependencies {
    5859      get { return dependencies; }
    5960    }
    6061    private List<string> assemblies = new List<string>();
    61 
    6262    /// <summary>
    6363    /// Names of the assemblies that belong to this plugin.
     
    6767      set { assemblies = value; }
    6868    }
    69 
    70 
    7169    private string message;
    7270    public string Message {
     
    7472      set { message = value; }
    7573    }
    76 
    7774    public override string ToString() {
    7875      return Name;
    7976    }
    80 
    8177    // equals and hashcode have to be implemented because we want to compare PluginDescriptions from
    8278    // different AppDomains and serialization destroys reference equality
     
    8884      return other.Name == this.Name && other.Version == this.Version;
    8985    }
    90 
    9186    public override int GetHashCode() {
    9287      if(version != null) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/Properties/AssemblyInfo.frame

    r30 r91  
    2323using System.Runtime.CompilerServices;
    2424using System.Runtime.InteropServices;
     25using HeuristicLab.PluginInfrastructure;
    2526
    2627// General Information about an assembly is controlled through the following
Note: See TracChangeset for help on using the changeset viewer.