Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/11/09 18:25:15 (14 years ago)
Author:
gkronber
Message:

Refactored class Loader in plugin infrastructure. #799

Location:
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure.Manager
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure.Manager

    • Property svn:ignore
      •  

        old new  
        11bin
        22obj
         3HeuristicLab.PluginInfrastructure.Manager.csproj.user
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure.Manager/PluginDescription.cs

    r2472 r2481  
    2424using System.Text;
    2525
    26 namespace HeuristicLab.PluginInfrastructure {
     26namespace HeuristicLab.PluginInfrastructure.Manager {
    2727  /// <summary>
    2828  /// Holds information of loaded plugins that is needed for plugin management.
     
    3030  /// </summary>
    3131  [Serializable]
    32   public class PluginInfo {
     32  public class PluginDescription {
    3333    private string name;
    3434    /// <summary>
     
    5555      set { buildDate = value; }
    5656    }
     57
     58    private PluginState pluginState;
     59    /// <summary>
     60    /// Gets or sets the plugin state.
     61    /// </summary>
     62    public PluginState PluginState {
     63      get { return pluginState; }
     64      set { pluginState = value; }
     65    }
     66
    5767    private List<string> files = new List<string>();
    5868    /// <summary>
     
    6070    /// These files are deleted when the plugin is removed or updated.
    6171    /// </summary>
    62     public List<string> Files {
     72    public IEnumerable<string> Files {
    6373      get { return files; }
    6474    }
    6575
    66     private List<PluginInfo> dependencies = new List<PluginInfo>();
     76    internal void AddFiles(IEnumerable<string> fileNames) {
     77      files.AddRange(fileNames);
     78    }
     79
     80    private List<PluginDescription> dependencies = new List<PluginDescription>();
    6781    /// <summary>
    6882    /// Gets all dependencies of the plugin.
    6983    /// </summary>
    70     public List<PluginInfo> Dependencies {
     84    public IEnumerable<PluginDescription> Dependencies {
    7185      get { return dependencies; }
    7286    }
     87
     88    public void AddDependency(PluginDescription dependency) {
     89      dependencies.Add(dependency);
     90    }
     91
     92
    7393    private List<string> assemblies = new List<string>();
    7494    /// <summary>
    7595    /// Gets the names of the assemblies that belong to this plugin.
    7696    /// </summary>
    77     public List<string> Assemblies {
     97    public IEnumerable<string> Assemblies {
    7898      get { return assemblies; }
    79       set { assemblies = value; }
     99      // set { assemblies = value; }
    80100    }
    81     private string message;
    82     /// <summary>
    83     /// Gets or sets the message.
    84     /// </summary>
    85     public string Message {
    86       get { return message; }
    87       set { message = value; }
     101
     102    internal void AddAssemblies(IEnumerable<string> assemblyNames) {
     103      assemblies.AddRange(assemblyNames);
    88104    }
     105
     106    //private string message;
     107    ///// <summary>
     108    ///// Gets or sets the message.
     109    ///// </summary>
     110    //public string Message {
     111    //  get { return message; }
     112    //  set { message = value; }
     113    //}
     114
    89115    /// <summary>
    90116    /// Gets the string representation of the plugin.
     
    94120      return Name;
    95121    }
    96    
     122
    97123    // equals and hashcode have to be implemented because we want to compare PluginDescriptions from
    98124    // different AppDomains and serialization destroys reference equality
     
    103129    /// <returns><c>true</c> if it is equal, <c>false</c> otherwise.</returns>
    104130    public override bool Equals(object obj) {
    105       if(!(obj is PluginInfo))
     131      if (!(obj is PluginDescription))
    106132        return false;
    107       PluginInfo other = (PluginInfo)obj;
     133      PluginDescription other = (PluginDescription)obj;
    108134
    109135      return other.Name == this.Name && other.Version == this.Version;
     
    114140    /// <returns>The hash code of the plugin.</returns>
    115141    public override int GetHashCode() {
    116       if(version != null) {
     142      if (version != null) {
    117143        return name.GetHashCode() + version.GetHashCode();
    118144      } else return name.GetHashCode();
Note: See TracChangeset for help on using the changeset viewer.