Changeset 2815 for trunk/sources/HeuristicLab.PluginInfrastructure
- Timestamp:
- 02/16/10 18:36:45 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/Interfaces/IPluginDescription.cs
r2790 r2815 49 49 /// </summary> 50 50 IEnumerable<IPluginFile> Files { get; } 51 /// <summary> 52 /// Gets the name of the contact person of the plugin. 53 /// </summary> 54 string ContactName { get; } 55 /// <summary> 56 /// Gets the e-mail address of the contact person of the plugin. 57 /// </summary> 58 string ContactEmail { get; } 59 /// <summary> 60 /// Gets the license text of the plugin. 61 /// </summary> 62 string LicenseText { get; } 51 63 } 52 64 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Manager/PluginDescription.cs
r2790 r2815 75 75 /// Gets or sets the name of the contact person for this plugin. 76 76 /// </summary> 77 internalstring ContactName {77 public string ContactName { 78 78 get { return contactName; } 79 set { contactName = value; }79 internal set { contactName = value; } 80 80 } 81 81 … … 84 84 /// Gets or sets the e-mail address of the contact person for this plugin. 85 85 /// </summary> 86 internalstring ContactEmail {86 public string ContactEmail { 87 87 get { return contactEmail; } 88 set { contactEmail = value; } 88 internal set { contactEmail = value; } 89 } 90 private string licenseText; 91 /// <summary> 92 /// Gets or sets the license text of the plugin. 93 /// </summary> 94 public string LicenseText { 95 get { return licenseText; } 96 internal set { licenseText = value; } 89 97 } 90 98 -
trunk/sources/HeuristicLab.PluginInfrastructure/Manager/PluginValidator.cs
r2790 r2815 286 286 info.ContactName = contactName; 287 287 info.ContactEmail = contactAddress; 288 info.LicenseText = ReadLicenseFiles(pluginFiles); 288 289 info.AddFiles(pluginFiles); 289 290 … … 293 294 throw new InvalidPluginException("Invalid metadata in plugin " + pluginType.ToString()); 294 295 } 296 } 297 298 private string ReadLicenseFiles(IEnumerable<PluginFile> pluginFiles) { 299 // combine the contents of all plugin files 300 var licenseFiles = from file in pluginFiles 301 where file.Type == PluginFileType.License 302 select file; 303 if (licenseFiles.Count() == 0) return string.Empty; 304 StringBuilder licenseTextBuilder = new StringBuilder(); 305 licenseTextBuilder.AppendLine(File.ReadAllText(licenseFiles.First().Name)); 306 foreach (var licenseFile in licenseFiles.Skip(1)) { 307 licenseTextBuilder.AppendLine().AppendLine(); // leave some empty space between multiple license files 308 licenseTextBuilder.AppendLine(File.ReadAllText(licenseFile.Name)); 309 } 310 return licenseTextBuilder.ToString(); 295 311 } 296 312
Note: See TracChangeset
for help on using the changeset viewer.