Changeset 2481 for branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure.Manager/PluginDescription.cs
- Timestamp:
- 11/11/09 18:25:15 (14 years ago)
- 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 1 1 bin 2 2 obj 3 HeuristicLab.PluginInfrastructure.Manager.csproj.user
-
- Property svn:ignore
-
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure.Manager/PluginDescription.cs
r2472 r2481 24 24 using System.Text; 25 25 26 namespace HeuristicLab.PluginInfrastructure {26 namespace HeuristicLab.PluginInfrastructure.Manager { 27 27 /// <summary> 28 28 /// Holds information of loaded plugins that is needed for plugin management. … … 30 30 /// </summary> 31 31 [Serializable] 32 public class Plugin Info{32 public class PluginDescription { 33 33 private string name; 34 34 /// <summary> … … 55 55 set { buildDate = value; } 56 56 } 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 57 67 private List<string> files = new List<string>(); 58 68 /// <summary> … … 60 70 /// These files are deleted when the plugin is removed or updated. 61 71 /// </summary> 62 public List<string> Files {72 public IEnumerable<string> Files { 63 73 get { return files; } 64 74 } 65 75 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>(); 67 81 /// <summary> 68 82 /// Gets all dependencies of the plugin. 69 83 /// </summary> 70 public List<PluginInfo> Dependencies {84 public IEnumerable<PluginDescription> Dependencies { 71 85 get { return dependencies; } 72 86 } 87 88 public void AddDependency(PluginDescription dependency) { 89 dependencies.Add(dependency); 90 } 91 92 73 93 private List<string> assemblies = new List<string>(); 74 94 /// <summary> 75 95 /// Gets the names of the assemblies that belong to this plugin. 76 96 /// </summary> 77 public List<string> Assemblies {97 public IEnumerable<string> Assemblies { 78 98 get { return assemblies; } 79 set { assemblies = value; }99 // set { assemblies = value; } 80 100 } 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); 88 104 } 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 89 115 /// <summary> 90 116 /// Gets the string representation of the plugin. … … 94 120 return Name; 95 121 } 96 122 97 123 // equals and hashcode have to be implemented because we want to compare PluginDescriptions from 98 124 // different AppDomains and serialization destroys reference equality … … 103 129 /// <returns><c>true</c> if it is equal, <c>false</c> otherwise.</returns> 104 130 public override bool Equals(object obj) { 105 if (!(obj is PluginInfo))131 if (!(obj is PluginDescription)) 106 132 return false; 107 Plugin Info other = (PluginInfo)obj;133 PluginDescription other = (PluginDescription)obj; 108 134 109 135 return other.Name == this.Name && other.Version == this.Version; … … 114 140 /// <returns>The hash code of the plugin.</returns> 115 141 public override int GetHashCode() { 116 if (version != null) {142 if (version != null) { 117 143 return name.GetHashCode() + version.GetHashCode(); 118 144 } else return name.GetHashCode();
Note: See TracChangeset
for help on using the changeset viewer.