- Timestamp:
- 02/16/10 18:36:45 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.