Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/27/10 11:11:52 (14 years ago)
Author:
gkronber
Message:

Implemented an enumerable to iterate through all PluginFiles as suggested by swagner, replaced the Assemblies enumerable with an AssemblyName enumerable for internal usage in the plugin infrastructure and replaced Assembly.LoadFrom calls with Assembly.Load() to prevent loading from GAC as far as possible.

#850 (PluginInfrastructure should provide a way to get assemblies associated with a plug-in)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManager.cs

    r2612 r2688  
    2828using System.ComponentModel;
    2929using HeuristicLab.PluginInfrastructure.UpdateLocationReference;
     30using System.Reflection;
    3031
    3132namespace HeuristicLab.PluginInfrastructure.Advanced {
     
    6768      builder.Append("Build date: ").AppendLine(desc.BuildDate.ToString());
    6869      builder.AppendLine("Files: ");
    69       foreach (string fileName in desc.Files) {
     70      foreach (string fileName in from file in desc.Files select file.Name) {
    7071        builder.AppendLine(fileName);
    7172      }
     
    9596      StringBuilder builder = new StringBuilder();
    9697      var missingFiles = from x in desc.Files
    97                          where !File.Exists(x)
    98                          select x;
     98                         where !File.Exists(x.Name)
     99                         select x.Name;
    99100      if (missingFiles.Count() > 0) {
    100         foreach (string fileName in desc.Files) {
     101        foreach (string fileName in from file in desc.Files select file.Name) {
    101102          if (!File.Exists(fileName)) builder.Append("Missing file: ").AppendLine(fileName);
    102103        }
     
    126127            // or there was a problem loading the assemblies
    127128            builder.AppendLine("There was a problem while loading assemblies: ");
    128             foreach (string assembly in desc.Assemblies) {
    129               builder.AppendLine(assembly);
     129            foreach (AssemblyName assembly in desc.AssemblyNames) {
     130              builder.AppendLine(assembly.FullName);
    130131            }
    131132            return builder.ToString();
     
    196197    public void Remove(IEnumerable<string> pluginNames) {
    197198      var fileNames = from pluginToDelete in PluginDescriptionIterator.IterateDependentsTopDown(GetPluginDescriptions(pluginNames), pluginManager.Plugins)
    198                       from fileName in pluginToDelete.Files
    199                       select Path.Combine(pluginDir, fileName);
     199                      from file in pluginToDelete.Files
     200                      select Path.Combine(pluginDir, file.Name);
    200201      var args = new PluginInfrastructureCancelEventArgs("Deleting", fileNames);
    201202      OnPreDelete(args);
Note: See TracChangeset for help on using the changeset viewer.