Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/09 20:27:43 (15 years ago)
Author:
gkronber
Message:

Implemented changes as requested by swagner. #799

Location:
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure
Files:
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Advanced/InstallationManager.cs

    r2517 r2527  
    116116
    117117    private static IEnumerable<string> GetDeclaredDependencies(PluginDescription desc) {
    118       var plugin = DefaultApplicationManager.GetInstances<IPlugin>(desc).Single();
     118      var plugin = ApplicationManager.GetInstances<IPlugin>(desc).Single();
    119119      return plugin.GetType().GetCustomAttributes(typeof(PluginDependencyAttribute), false).Cast<PluginDependencyAttribute>().Select(x => x.Dependency);
    120120    }
     
    146146
    147147    public void Install(IEnumerable<string> pluginNames) {
    148       IEnumerable<PluginInformation> pluginsToInstall;
    149       using (UpdateLocationClient updateLocation = new UpdateLocationClient()) {
    150         pluginsToInstall = from pluginName in pluginNames
    151                                select GetMatchingPluginInformation(pluginName, updateLocation.GetAvailablePlugins());
    152 
    153         var args = new PluginInfrastructureCancelEventArgs("Installing", pluginsToInstall);
    154         OnPreInstall(args);
    155         foreach (var pluginInfo in pluginsToInstall) {
    156           var s = updateLocation.GetPackedPlugin(pluginInfo);
    157           Console.WriteLine("Downloading: {0} {1} {2}", pluginInfo.Name, pluginInfo.Version, pluginInfo.BuildDate);
    158         }
    159       }
    160       OnInstalled(new PluginInfrastructureEventArgs("Installed", pluginsToInstall));
    161     }
    162 
    163     private static PluginInformation GetMatchingPluginInformation(string pluginName, IEnumerable<PluginInformation> plugins) {
    164       var exactMatch = from pluginDesc in plugins
    165                        where string.Equals(pluginName, pluginDesc.Name, StringComparison.InvariantCultureIgnoreCase)
    166                        select pluginDesc;
    167       var inexactMatch = from pluginDesc in plugins
    168                          where MatchPluginNameInexact(pluginName, pluginDesc.Name)
    169                          select pluginDesc;
    170       return exactMatch.Count() > 0 ? exactMatch.Single() : inexactMatch.First();
    171     }
     148      throw new NotImplementedException();
     149      //IEnumerable<PluginInformation> pluginsToInstall;
     150      //using (UpdateLocationClient updateLocation = new UpdateLocationClient()) {
     151      //  pluginsToInstall = from pluginName in pluginNames
     152      //                     from matchingPlugin in updateLocation.GetAvailablePluginsByName(pluginName)
     153      //                     select matchingPlugin;
     154
     155      //  var args = new PluginInfrastructureCancelEventArgs("Installing", pluginsToInstall);
     156      //  OnPreInstall(args);
     157      //  foreach (var pluginInfo in pluginsToInstall) {
     158      //    var s = updateLocation.GetPluginFiles(pluginInfo);
     159      //    Console.WriteLine("Downloading: {0} {1} {2}", pluginInfo.Name, pluginInfo.Version, pluginInfo.BuildDate);
     160      //  }
     161      //}
     162      //OnInstalled(new PluginInfrastructureEventArgs("Installed", pluginsToInstall));
     163    }
     164
     165    //private static PluginInformation GetMatchingPluginInformation(string pluginName, IEnumerable<PluginInformation> plugins) {
     166    //  var exactMatch = from pluginDesc in plugins
     167    //                   where string.Equals(pluginName, pluginDesc.Name, StringComparison.InvariantCultureIgnoreCase)
     168    //                   select pluginDesc;
     169    //  var inexactMatch = from pluginDesc in plugins
     170    //                     where MatchPluginNameInexact(pluginName, pluginDesc.Name)
     171    //                     select pluginDesc;
     172    //  return exactMatch.Count() > 0 ? exactMatch.Single() : inexactMatch.First();
     173    //}
    172174
    173175    public void Remove(IEnumerable<string> pluginNames) {
     
    188190
    189191    public void Update(IEnumerable<string> pluginNames) {
    190       throw new NotImplementedException();
     192      var pluginDescriptions = from name in pluginNames
     193                               select GetPluginDescription(name);
     194      Dictionary<PluginInformation, string> matchingPlugins = new Dictionary<PluginInformation, string>();
     195      foreach (var updateLocation in HeuristicLab.PluginInfrastructure.Properties.Settings.Default.UpdateLocations) {
     196        using (UpdateLocationClient client = new UpdateLocationClient("", updateLocation)) {
     197          var updateLocationMatchingPlugins = from desc in pluginDescriptions
     198                                              from info in client.GetAvailablePluginsByName(desc.Name)
     199                                              select info;
     200          foreach (PluginInformation info in updateLocationMatchingPlugins) {
     201            // keep only the highest version and most recent build of any plugin
     202            var existingPlugin = matchingPlugins.Keys.FirstOrDefault(x => x.Name == info.Name);
     203            if (existingPlugin == null || existingPlugin.Version < info.Version || (existingPlugin.Version == info.Version && existingPlugin.BuildDate < info.BuildDate)) {
     204              matchingPlugins.Remove(existingPlugin);
     205              matchingPlugins.Add(info, updateLocation);
     206            }
     207          }
     208        }
     209      }
     210      PluginInfrastructureCancelEventArgs args = new PluginInfrastructureCancelEventArgs("Updating", matchingPlugins.Keys);
     211      OnPreUpdate(args);
     212      if (!args.Cancel) {
     213        var groupedInfos = matchingPlugins.GroupBy(x => x.Value);
     214        foreach (var group in groupedInfos) {
     215          using (UpdateLocationClient client = new UpdateLocationClient(group.Key)) {
     216            foreach (var info in group) {
     217              client.GetPluginFiles(info.Key);
     218            }
     219          }
     220        }
     221        OnUpdated(new PluginInfrastructureEventArgs("Updated", matchingPlugins.Keys));
     222      }
     223    }
     224
     225    private void OnPreUpdate(PluginInfrastructureCancelEventArgs args) {
     226      if (PreUpdatePlugin != null) PreUpdatePlugin(this, args);
     227    }
     228
     229    private void OnUpdated(PluginInfrastructureEventArgs args) {
     230      if (PluginUpdated != null) PluginUpdated(this, args);
    191231    }
    192232
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerConsole.cs

    r2517 r2527  
    66using System.IO;
    77using System.ComponentModel;
     8using HeuristicLab.PluginInfrastructure.UpdateLocationReference;
    89
    910namespace HeuristicLab.PluginInfrastructure.Advanced {
    1011  public class InstallationManagerConsole {
    1112    private InstallationManager installManager;
    12     public InstallationManagerConsole() {
    13       this.installManager = new InstallationManager(Path.GetFullPath(HeuristicLab.PluginInfrastructure.Properties.Settings.Default.PluginDir));
     13    public InstallationManagerConsole(string pluginDir) {
     14      this.installManager = new InstallationManager(pluginDir);
    1415      installManager.PreInstallPlugin += new EventHandler<PluginInfrastructureCancelEventArgs>(installManager_PreInstallPlugin);
    1516      installManager.PreRemovePlugin += new EventHandler<PluginInfrastructureCancelEventArgs>(installManager_PreRemovePlugin);
     
    2122
    2223    void installManager_PreUpdatePlugin(object sender, PluginInfrastructureCancelEventArgs e) {
    23       throw new NotImplementedException();
     24      Console.WriteLine("Following plugins are updated:");
     25      var infos = (IEnumerable<PluginInformation>)e.Entity;
     26      foreach (var info in infos) {
     27        Console.WriteLine(info.Name + " " + info.Version + " " + info.BuildDate);
     28      }
     29      if (GetUserConfirmation()) e.Cancel = false;
     30      else e.Cancel = true;
     31      return;
    2432    }
    2533
    2634    void installManager_PluginUpdated(object sender, PluginInfrastructureEventArgs e) {
    27       throw new NotImplementedException();
     35      foreach (var info in (IEnumerable<PluginInformation>)e.Entity)
     36        Console.WriteLine("Updated: {0}", info.Name);
    2837    }
    2938
     
    4554
    4655    void installManager_PreInstallPlugin(object sender, PluginInfrastructureCancelEventArgs e) {
    47      
     56
    4857    }
    4958
    5059    void installManager_PluginInstalled(object sender, PluginInfrastructureEventArgs e) {
    51      
     60
    5261    }
    5362
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/ApplicationManager.cs

    r2503 r2527  
    2828using System.Security;
    2929using System.Linq;
     30using HeuristicLab.PluginInfrastructure.Manager;
     31using System.IO;
    3032
    3133namespace HeuristicLab.PluginInfrastructure {
     
    3537  /// The application manager provides
    3638  /// </summary>
    37   public static class ApplicationManager {
     39  public sealed class ApplicationManager : MarshalByRefObject, IApplicationManager {
    3840    private static IApplicationManager appManager;
    3941    /// <summary>
     
    4244    public static IApplicationManager Manager {
    4345      get { return appManager; }
     46    }
     47
     48    internal event EventHandler<PluginInfrastructureEventArgs> PluginLoaded;
     49    internal event EventHandler<PluginInfrastructureEventArgs> PluginUnloaded;
     50
     51    // cache for the AssemblyResolveEvent
     52    // which must be handled when assemblies are loaded dynamically after the application start
     53    private Dictionary<string, Assembly> loadedAssemblies;
     54
     55    private List<IPlugin> loadedPlugins;
     56
     57    private List<PluginDescription> plugins;
     58    /// <summary>
     59    /// Gets all plugins.
     60    /// </summary>
     61    public IEnumerable<IPluginDescription> Plugins {
     62      get { return plugins.Cast<IPluginDescription>(); }
     63    }
     64
     65    private List<ApplicationDescription> applications;
     66    /// <summary>
     67    /// Gets all installed applications.
     68    /// </summary>
     69    public IEnumerable<IApplicationDescription> Applications {
     70      get { return applications.Cast<IApplicationDescription>(); }
     71    }
     72
     73    internal ApplicationManager()
     74      : base() {
     75      loadedAssemblies = new Dictionary<string, Assembly>();
     76      loadedPlugins = new List<IPlugin>();
     77      // needed for the special case when assemblies are loaded dynamically via LoadAssemblies()
     78      AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => {
     79        if (loadedAssemblies.ContainsKey(args.Name)) {
     80          return loadedAssemblies[args.Name];
     81        }
     82        return null;
     83      };
     84    }
     85
     86    internal void PrepareApplicationDomain(IEnumerable<ApplicationDescription> apps, IEnumerable<PluginDescription> plugins) {
     87      this.plugins = new List<PluginDescription>(plugins);
     88      this.applications = new List<ApplicationDescription>(apps);
     89      RegisterApplicationManager((IApplicationManager)this);
     90      LoadPlugins(plugins);
    4491    }
    4592
     
    5299      appManager = manager;
    53100    }
     101
     102    private void LoadPlugins(IEnumerable<PluginDescription> plugins) {
     103      // load all loadable plugins (all dependencies available) into the execution context
     104      foreach (var desc in PluginDescriptionIterator.IterateDependenciesBottomUp(plugins.Where(x => x.PluginState != PluginState.Disabled))) {
     105        foreach (string assembly in desc.Assemblies) {
     106          var asm = Assembly.LoadFrom(assembly);
     107
     108          // instantiate and load all plugins in this assembly
     109          foreach (var plugin in GetInstances<IPlugin>(asm)) {
     110            plugin.OnLoad();
     111            loadedPlugins.Add(plugin);
     112          }
     113        }
     114        OnPluginLoaded(new PluginInfrastructureEventArgs("Plugin loaded", desc));
     115        desc.Load();
     116      }
     117    }
     118
     119    internal void Run(ApplicationDescription appInfo) {
     120      IApplication runnablePlugin = (IApplication)Activator.CreateInstance(appInfo.DeclaringAssemblyName, appInfo.DeclaringTypeName).Unwrap();
     121      try {
     122        runnablePlugin.Run();
     123      }
     124      finally {
     125        // unload plugins in reverse order
     126        foreach (var plugin in loadedPlugins.Reverse<IPlugin>()) {
     127          plugin.OnUnload();
     128        }
     129        foreach (var desc in PluginDescriptionIterator.IterateDependenciesBottomUp(plugins.Where(x => x.PluginState != PluginState.Disabled))) {
     130          desc.Unload();
     131          OnPluginUnloaded(new PluginInfrastructureEventArgs("Plugin unloaded", desc));
     132        }
     133      }
     134    }
     135
     136    /// <summary>
     137    /// Loads assemblies dynamically from a byte array
     138    /// </summary>
     139    /// <param name="plugins">bytearray of all assemblies that should be loaded</param>
     140    public void LoadAssemblies(IEnumerable<byte[]> assemblies) {
     141      foreach (byte[] asm in assemblies) {
     142        Assembly loadedAsm = Assembly.Load(asm);
     143        RegisterLoadedAssembly(loadedAsm);
     144      }
     145    }
     146
     147    // register assembly in the assembly cache for the AssemblyResolveEvent
     148    private void RegisterLoadedAssembly(Assembly asm) {
     149      loadedAssemblies.Add(asm.FullName, asm);
     150      loadedAssemblies.Add(asm.GetName().Name, asm); // add short name
     151    }
     152
     153    /// <summary>
     154    /// Creates an instance of all types that are subtypes or the same type of the specified type and declared in <paramref name="plugin"/>
     155    /// </summary>
     156    /// <typeparam name="T">Most general type.</typeparam>
     157    /// <returns>Enumerable of the created instances.</returns>
     158    public static IEnumerable<T> GetInstances<T>(IPluginDescription plugin) where T : class {
     159      return from t in GetTypes(typeof(T), plugin)
     160             select (T)Activator.CreateInstance(t);
     161    }
     162    /// <summary>
     163    /// Creates an instance of all types declared in assembly <param name="asm"/> that are subtypes or the same type of the specified type and declared in <paramref name="plugin"/>
     164    /// </summary>
     165    /// <typeparam name="T">Most general type.</typeparam>
     166    /// <param name="asm">Declaring assembly.</param>
     167    /// <returns>Enumerable of the created instances.</returns>
     168    private static IEnumerable<T> GetInstances<T>(Assembly asm) where T : class {
     169      return from t in GetTypes(typeof(T), asm)
     170             select (T)Activator.CreateInstance(t);
     171    }
     172    /// <summary>
     173    /// Creates an instance of all types that are subtypes or the same type of the specified type
     174    /// </summary>
     175    /// <typeparam name="T">Most general type.</typeparam>
     176    /// <returns>Enumerable of the created instances.</returns>
     177    public static IEnumerable<T> GetInstances<T>() where T : class {
     178      return from i in GetInstances(typeof(T))
     179             select (T)i;
     180    }
     181
     182    /// <summary>
     183    /// Creates an instance of all types that are subtypes or the same type of the specified type
     184    /// </summary>
     185    /// <typeparam name="type">Most general type.</typeparam>
     186    /// <returns>Enumerable of the created instances.</returns>
     187    public static IEnumerable<object> GetInstances(Type type) {
     188      return from t in GetTypes(type)
     189             select Activator.CreateInstance(t);
     190    }
     191
     192    /// <summary>
     193    /// Finds all types that are subtypes or equal to the specified type.
     194    /// </summary>
     195    /// <param name="type">Most general type for which to find matching types.</param>
     196    /// <returns>Enumerable of the discovered types.</returns>
     197    public static IEnumerable<Type> GetTypes(Type type) {
     198      return from asm in AppDomain.CurrentDomain.GetAssemblies()
     199             from t in GetTypes(type, asm)
     200             select t;
     201    }
     202
     203    /// <summary>
     204    /// Finds all types that are subtypes or equal to the specified type if they are part of the given
     205    /// <paramref name="plugin"/>.
     206    /// </summary>
     207    /// <param name="type">Most general type for which to find matching types.</param>
     208    /// <param name="plugin">The plugin the subtypes must be part of.</param>
     209    /// <returns>Enumerable of the discovered types.</returns>
     210    public static IEnumerable<Type> GetTypes(Type type, IPluginDescription pluginDescription) {
     211      PluginDescription pluginDesc = (PluginDescription)pluginDescription;
     212      return from asm in AppDomain.CurrentDomain.GetAssemblies()
     213             where pluginDesc.Assemblies.Any(asmPath => Path.GetFullPath(asmPath) == Path.GetFullPath(asm.Location))
     214             from t in GetTypes(type, asm)
     215             select t;
     216    }
     217
     218    /// <summary>
     219    /// Gets types that are assignable (same of subtype) to the specified type only from the given assembly.
     220    /// </summary>
     221    /// <param name="type">Most general type we want to find.</param>
     222    /// <param name="assembly">Assembly that should be searched for types.</param>
     223    /// <returns>Enumerable of the discovered types.</returns>
     224    private static IEnumerable<Type> GetTypes(Type type, Assembly assembly) {
     225      return GetTypes(type, assembly, false);
     226    }
     227
     228    private static IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool includeNotInstantiableTypes) {
     229      return from t in assembly.GetTypes()
     230             where type.IsAssignableFrom(t)
     231             where includeNotInstantiableTypes || (type.IsAssignableFrom(t) && !t.IsAbstract && !t.IsInterface && !t.HasElementType)
     232             select t;
     233    }
     234
     235    private void OnPluginLoaded(PluginInfrastructureEventArgs e) {
     236      if (PluginLoaded != null) PluginLoaded(this, e);
     237    }
     238
     239    private void OnPluginUnloaded(PluginInfrastructureEventArgs e) {
     240      if (PluginUnloaded != null) PluginUnloaded(this, e);
     241    }
     242
     243    // infinite lease time
     244    /// <summary>
     245    /// Initializes the life time service with infinite lease time.
     246    /// </summary>
     247    /// <returns><c>null</c>.</returns>
     248    public override object InitializeLifetimeService() {
     249      return null;
     250    }
     251
     252    #region IApplicationManager Members
     253
     254
     255    IEnumerable<T> IApplicationManager.GetInstances<T>(IPluginDescription plugin) {
     256      return GetInstances<T>(plugin);
     257    }
     258
     259    IEnumerable<T> IApplicationManager.GetInstances<T>() {
     260      return GetInstances<T>();
     261    }
     262
     263    IEnumerable<Type> IApplicationManager.GetTypes(Type type) {
     264      return GetTypes(type);
     265    }
     266
     267    IEnumerable<Type> IApplicationManager.GetTypes(Type type, IPluginDescription plugin) {
     268      return GetTypes(type, plugin);
     269    }
     270
     271    #endregion
    54272  }
    55273}
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/HeuristicLab.PluginInfrastructure.csproj

    r2517 r2527  
    111111    <Compile Include="Manager\ApplicationDescription.cs" />
    112112    <Compile Include="Manager\PluginInfrastructureCancelEventArgs.cs" />
    113     <Compile Include="Manager\DefaultApplicationManager.cs" />
    114113    <Compile Include="Manager\PluginDescription.cs" />
    115114    <Compile Include="Manager\PluginInfrastructureEventArgs.cs" />
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/ApplicationDescription.cs

    r2517 r2527  
    5353    /// Gets or sets the description of the application.
    5454    /// </summary>
    55     internal string Description {
     55    public string Description {
    5656      get { return description; }
    57       set { description = value; }
     57      internal set { description = value; }
    5858    }
    5959
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/PluginManager.cs

    r2513 r2527  
    104104        AppDomain.Unload(pluginDomain);
    105105        // unload all plugins
    106         foreach (var pluginDescription in plugins)
     106        foreach (var pluginDescription in plugins.Where(x => x.PluginState == PluginState.Loaded))
    107107          pluginDescription.Unload();
    108108        initialized = true;
     
    128128        setup.PrivateBinPath = pluginDir;
    129129        applicationDomain = AppDomain.CreateDomain(appInfo.Name, null, setup);
    130         Type applicationManagerType = typeof(DefaultApplicationManager);
    131         DefaultApplicationManager applicationManager =
    132           (DefaultApplicationManager)applicationDomain.CreateInstanceAndUnwrap(applicationManagerType.Assembly.FullName, applicationManagerType.FullName, true, BindingFlags.NonPublic | BindingFlags.Instance, null, null, null, null, null);
     130        Type applicationManagerType = typeof(ApplicationManager);
     131        ApplicationManager applicationManager =
     132          (ApplicationManager)applicationDomain.CreateInstanceAndUnwrap(applicationManagerType.Assembly.FullName, applicationManagerType.FullName, true, BindingFlags.NonPublic | BindingFlags.Instance, null, null, null, null, null);
    133133        applicationManager.PluginLoaded += applicationManager_PluginLoaded;
    134134        applicationManager.PluginUnloaded += applicationManager_PluginUnloaded;
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/PluginValidator.cs

    r2517 r2527  
    2727using System.Diagnostics;
    2828using System.Linq;
     29using System.Security;
    2930
    3031
     
    8687      pluginDependencies.Clear();
    8788
    88       IEnumerable<Assembly> reflectionOnlyAssemblies = ReflectionOnlyLoadDlls();
     89      IEnumerable<Assembly> reflectionOnlyAssemblies = ReflectionOnlyLoadDlls(PluginDir);
    8990      IEnumerable<PluginDescription> pluginDescriptions = GatherPluginDescriptions(reflectionOnlyAssemblies);
    9091      CheckPluginFiles(pluginDescriptions);
     92
     93      CheckPluginAssemblies(pluginDescriptions);
    9194
    9295      // a full list of plugin descriptions is available now we can build the dependency tree
     
    137140    }
    138141
    139     private IEnumerable<Assembly> ReflectionOnlyLoadDlls() {
     142    private static IEnumerable<Assembly> ReflectionOnlyLoadDlls(string baseDir) {
    140143      List<Assembly> assemblies = new List<Assembly>();
     144      // recursively load .dll files in subdirectories
     145      foreach (string dirName in Directory.GetDirectories(baseDir)) {
     146        assemblies.AddRange(ReflectionOnlyLoadDlls(dirName));
     147      }
    141148      // try to load each .dll file in the plugin directory into the reflection only context
    142       foreach (string filename in Directory.GetFiles(PluginDir, "*.dll")) {
     149      foreach (string filename in Directory.GetFiles(baseDir, "*.dll")) {
    143150        try {
    144151          assemblies.Add(Assembly.ReflectionOnlyLoadFrom(filename));
    145152        }
    146153        catch (BadImageFormatException) { } // just ignore the case that the .dll file is not a CLR assembly (e.g. a native dll)
     154        catch (FileLoadException) { }
     155        catch (SecurityException) { }
    147156      }
    148157      return assemblies;
    149158    }
     159
     160    /// <summary>
     161    /// Checks if all plugin assemblies can be loaded. If an assembly can't be loaded the plugin is disabled.
     162    /// </summary>
     163    /// <param name="pluginDescriptions"></param>
     164    private void CheckPluginAssemblies(IEnumerable<PluginDescription> pluginDescriptions) {
     165      foreach (var desc in pluginDescriptions.Where(x => x.PluginState != PluginState.Disabled)) {
     166        try {
     167          foreach (var asm in desc.Assemblies) {
     168            Assembly.ReflectionOnlyLoadFrom(asm);
     169          }
     170        }
     171        catch (BadImageFormatException) {
     172          // disable the plugin
     173          desc.Disable();
     174        }
     175        catch (FileNotFoundException) {
     176          // disable the plugin
     177          desc.Disable();
     178        }
     179        catch (FileLoadException) {
     180          // disable the plugin
     181          desc.Disable();
     182        }
     183        catch (ArgumentException) {
     184          // disable the plugin
     185          desc.Disable();
     186        }
     187        catch (SecurityException) {
     188          // disable the plugin
     189          desc.Disable();
     190        }
     191      }
     192    }
     193
    150194
    151195    // find all types implementing IPlugin in the reflectionOnlyAssemblies and create a list of plugin descriptions
     
    158202        // of the current assembly is missing.
    159203        try {
    160           foreach (Type t in assembly.GetExportedTypes()) {
    161             // if there is a type that implements IPlugin
    162             // use AssemblyQualifiedName to compare the types because we can't directly
    163             // compare ReflectionOnly types and Execution types
    164             if (!t.IsAbstract &&
    165                 t.GetInterfaces().Any(x => x.AssemblyQualifiedName == typeof(IPlugin).AssemblyQualifiedName)) {
    166               // fetch the attributes of the IPlugin type
    167               pluginDescriptions.Add(GetPluginDescription(t));
    168             }
    169           }
     204          // if there is a type that implements IPlugin
     205          // use AssemblyQualifiedName to compare the types because we can't directly
     206          // compare ReflectionOnly types and execution types
     207          var assemblyPluginDescriptions = from t in assembly.GetExportedTypes()
     208                                           where !t.IsAbstract && t.GetInterfaces().Any(x => x.AssemblyQualifiedName == typeof(IPlugin).AssemblyQualifiedName)
     209                                           select GetPluginDescription(t);
     210          pluginDescriptions.AddRange(assemblyPluginDescriptions);
    170211        }
    171212        // ignore exceptions. Just don't yield a plugin description when an exception is thrown
     
    206247          string pluginFileName = (string)attributeData.ConstructorArguments[0].Value;
    207248          PluginFileType fileType = (PluginFileType)attributeData.ConstructorArguments[1].Value;
    208           pluginFiles.Add(Path.Combine(PluginDir, pluginFileName));
     249          pluginFiles.Add(Path.GetFullPath(Path.Combine(PluginDir, pluginFileName)));
    209250          if (fileType == PluginFileType.Assembly) {
    210             pluginAssemblies.Add(Path.Combine(PluginDir, pluginFileName));
     251            pluginAssemblies.Add(Path.GetFullPath(Path.Combine(PluginDir, pluginFileName)));
    211252          }
    212253        }
     
    302343
    303344    // checks if all declared plugin files are actually available and disables plugins with missing files
    304     private static void CheckPluginFiles(IEnumerable<PluginDescription> pluginDescriptions) {
     345    private void CheckPluginFiles(IEnumerable<PluginDescription> pluginDescriptions) {
    305346      foreach (PluginDescription desc in pluginDescriptions) {
    306347        if (!CheckPluginFiles(desc)) {
     
    310351    }
    311352
    312     private static bool CheckPluginFiles(PluginDescription pluginDescription) {
     353    private bool CheckPluginFiles(PluginDescription pluginDescription) {
    313354      foreach (string filename in pluginDescription.Files) {
    314         if (!File.Exists(filename)) {
     355        if (!FileLiesInDirectory(PluginDir, filename) ||
     356          !File.Exists(filename)) {
    315357          return false;
    316358        }
    317359      }
    318360      return true;
     361    }
     362
     363    private static bool FileLiesInDirectory(string dir, string fileName) {
     364      var basePath = Path.GetFullPath(dir);
     365      return Path.GetFullPath(fileName).StartsWith(basePath);
    319366    }
    320367
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Properties/Settings.Designer.cs

    r2504 r2527  
    2626        [global::System.Configuration.ApplicationScopedSettingAttribute()]
    2727        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    28         [global::System.Configuration.DefaultSettingValueAttribute("plugins")]
    29         public string PluginDir {
    30             get {
    31                 return ((string)(this["PluginDir"]));
    32             }
    33         }
    34        
    35         [global::System.Configuration.ApplicationScopedSettingAttribute()]
    36         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    37         [global::System.Configuration.DefaultSettingValueAttribute("")]
     28        [global::System.Configuration.DefaultSettingValueAttribute("Gabriel Kronberger")]
    3829        public string User {
    3930            get {
     
    4435        [global::System.Configuration.ApplicationScopedSettingAttribute()]
    4536        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    46         [global::System.Configuration.DefaultSettingValueAttribute("")]
     37        [global::System.Configuration.DefaultSettingValueAttribute("HEAL")]
    4738        public string Organization {
    4839            get {
     
    5041            }
    5142        }
     43       
     44        [global::System.Configuration.ApplicationScopedSettingAttribute()]
     45        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     46        [global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsi=\"http://www.w3." +
     47            "org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n  <s" +
     48            "tring>http://localhost:59253/UpdateLocation.svc</string>\r\n</ArrayOfString>")]
     49        public global::System.Collections.Specialized.StringCollection UpdateLocations {
     50            get {
     51                return ((global::System.Collections.Specialized.StringCollection)(this["UpdateLocations"]));
     52            }
     53        }
    5254    }
    5355}
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Properties/Settings.settings

    r2504 r2527  
    33  <Profiles />
    44  <Settings>
    5     <Setting Name="PluginDir" Type="System.String" Scope="Application">
    6       <Value Profile="(Default)">plugins</Value>
    7     </Setting>
    85    <Setting Name="User" Type="System.String" Scope="Application">
    9       <Value Profile="(Default)" />
     6      <Value Profile="(Default)">Gabriel Kronberger</Value>
    107    </Setting>
    118    <Setting Name="Organization" Type="System.String" Scope="Application">
    12       <Value Profile="(Default)" />
     9      <Value Profile="(Default)">HEAL</Value>
     10    </Setting>
     11    <Setting Name="UpdateLocations" Type="System.Collections.Specialized.StringCollection" Scope="Application">
     12      <Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
     13&lt;ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
     14  &lt;string&gt;http://localhost:59253/UpdateLocation.svc&lt;/string&gt;
     15&lt;/ArrayOfString&gt;</Value>
    1316    </Setting>
    1417  </Settings>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Service References/UpdateLocationReference/Reference.cs

    r2517 r2527  
    9595    internal interface IUpdateLocation {
    9696       
    97         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUpdateLocation/GetAvailablePlugins", ReplyAction="http://tempuri.org/IUpdateLocation/GetAvailablePluginsResponse")]
    98         HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation[] GetAvailablePlugins();
     97        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUpdateLocation/GetAvailablePluginsByName", ReplyAction="http://tempuri.org/IUpdateLocation/GetAvailablePluginsByNameResponse")]
     98        HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation[] GetAvailablePluginsByName(string name);
    9999       
    100         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUpdateLocation/GetPackedPlugin", ReplyAction="http://tempuri.org/IUpdateLocation/GetPackedPluginResponse")]
    101         System.IO.Stream GetPackedPlugin(HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation info);
     100        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUpdateLocation/GetPluginFiles", ReplyAction="http://tempuri.org/IUpdateLocation/GetPluginFilesResponse")]
     101        byte[][] GetPluginFiles(HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation info);
    102102    }
    103103   
     
    129129        }
    130130       
    131         public HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation[] GetAvailablePlugins() {
    132             return base.Channel.GetAvailablePlugins();
     131        public HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation[] GetAvailablePluginsByName(string name) {
     132            return base.Channel.GetAvailablePluginsByName(name);
    133133        }
    134134       
    135         public System.IO.Stream GetPackedPlugin(HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation info) {
    136             return base.Channel.GetPackedPlugin(info);
     135        public byte[][] GetPluginFiles(HeuristicLab.PluginInfrastructure.UpdateLocationReference.PluginInformation info) {
     136            return base.Channel.GetPluginFiles(info);
    137137        }
    138138    }
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Service References/UpdateLocationReference/UpdateLocation.wsdl

    r2517 r2527  
    107107    </wsp:ExactlyOne>
    108108  </wsp:Policy>
    109   <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetAvailablePlugins_Input_policy">
    110     <wsp:ExactlyOne>
    111       <wsp:All>
    112         <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    113           <sp:Body />
    114           <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
    115           <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
    116           <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
    117           <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
    118           <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
    119           <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
    120           <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
    121         </sp:SignedParts>
    122         <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    123           <sp:Body />
    124         </sp:EncryptedParts>
    125       </wsp:All>
    126     </wsp:ExactlyOne>
    127   </wsp:Policy>
    128   <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetAvailablePlugins_output_policy">
    129     <wsp:ExactlyOne>
    130       <wsp:All>
    131         <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    132           <sp:Body />
    133           <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
    134           <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
    135           <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
    136           <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
    137           <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
    138           <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
    139           <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
    140         </sp:SignedParts>
    141         <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    142           <sp:Body />
    143         </sp:EncryptedParts>
    144       </wsp:All>
    145     </wsp:ExactlyOne>
    146   </wsp:Policy>
    147   <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetPackedPlugin_Input_policy">
    148     <wsp:ExactlyOne>
    149       <wsp:All>
    150         <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    151           <sp:Body />
    152           <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
    153           <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
    154           <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
    155           <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
    156           <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
    157           <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
    158           <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
    159         </sp:SignedParts>
    160         <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    161           <sp:Body />
    162         </sp:EncryptedParts>
    163       </wsp:All>
    164     </wsp:ExactlyOne>
    165   </wsp:Policy>
    166   <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetPackedPlugin_output_policy">
     109  <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetAvailablePluginsByName_Input_policy">
     110    <wsp:ExactlyOne>
     111      <wsp:All>
     112        <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     113          <sp:Body />
     114          <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
     115          <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
     116          <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
     117          <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
     118          <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
     119          <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
     120          <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
     121        </sp:SignedParts>
     122        <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     123          <sp:Body />
     124        </sp:EncryptedParts>
     125      </wsp:All>
     126    </wsp:ExactlyOne>
     127  </wsp:Policy>
     128  <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetAvailablePluginsByName_output_policy">
     129    <wsp:ExactlyOne>
     130      <wsp:All>
     131        <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     132          <sp:Body />
     133          <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
     134          <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
     135          <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
     136          <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
     137          <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
     138          <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
     139          <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
     140        </sp:SignedParts>
     141        <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     142          <sp:Body />
     143        </sp:EncryptedParts>
     144      </wsp:All>
     145    </wsp:ExactlyOne>
     146  </wsp:Policy>
     147  <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetPluginFiles_Input_policy">
     148    <wsp:ExactlyOne>
     149      <wsp:All>
     150        <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     151          <sp:Body />
     152          <sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
     153          <sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
     154          <sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
     155          <sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
     156          <sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
     157          <sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
     158          <sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
     159        </sp:SignedParts>
     160        <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     161          <sp:Body />
     162        </sp:EncryptedParts>
     163      </wsp:All>
     164    </wsp:ExactlyOne>
     165  </wsp:Policy>
     166  <wsp:Policy wsu:Id="WSHttpBinding_IUpdateLocation_GetPluginFiles_output_policy">
    167167    <wsp:ExactlyOne>
    168168      <wsp:All>
     
    189189      <xsd:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Update.Service" />
    190190      <xsd:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/System" />
    191       <xsd:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd4" namespace="http://schemas.microsoft.com/Message" />
     191      <xsd:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd4" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
    192192    </xsd:schema>
    193193  </wsdl:types>
    194   <wsdl:message name="IUpdateLocation_GetAvailablePlugins_InputMessage">
    195     <wsdl:part name="parameters" element="tns:GetAvailablePlugins" />
    196   </wsdl:message>
    197   <wsdl:message name="IUpdateLocation_GetAvailablePlugins_OutputMessage">
    198     <wsdl:part name="parameters" element="tns:GetAvailablePluginsResponse" />
    199   </wsdl:message>
    200   <wsdl:message name="IUpdateLocation_GetPackedPlugin_InputMessage">
    201     <wsdl:part name="parameters" element="tns:GetPackedPlugin" />
    202   </wsdl:message>
    203   <wsdl:message name="IUpdateLocation_GetPackedPlugin_OutputMessage">
    204     <wsdl:part name="parameters" element="tns:GetPackedPluginResponse" />
     194  <wsdl:message name="IUpdateLocation_GetAvailablePluginsByName_InputMessage">
     195    <wsdl:part name="parameters" element="tns:GetAvailablePluginsByName" />
     196  </wsdl:message>
     197  <wsdl:message name="IUpdateLocation_GetAvailablePluginsByName_OutputMessage">
     198    <wsdl:part name="parameters" element="tns:GetAvailablePluginsByNameResponse" />
     199  </wsdl:message>
     200  <wsdl:message name="IUpdateLocation_GetPluginFiles_InputMessage">
     201    <wsdl:part name="parameters" element="tns:GetPluginFiles" />
     202  </wsdl:message>
     203  <wsdl:message name="IUpdateLocation_GetPluginFiles_OutputMessage">
     204    <wsdl:part name="parameters" element="tns:GetPluginFilesResponse" />
    205205  </wsdl:message>
    206206  <wsdl:portType name="IUpdateLocation">
    207     <wsdl:operation name="GetAvailablePlugins">
    208       <wsdl:input wsaw:Action="http://tempuri.org/IUpdateLocation/GetAvailablePlugins" message="tns:IUpdateLocation_GetAvailablePlugins_InputMessage" />
    209       <wsdl:output wsaw:Action="http://tempuri.org/IUpdateLocation/GetAvailablePluginsResponse" message="tns:IUpdateLocation_GetAvailablePlugins_OutputMessage" />
    210     </wsdl:operation>
    211     <wsdl:operation name="GetPackedPlugin">
    212       <wsdl:input wsaw:Action="http://tempuri.org/IUpdateLocation/GetPackedPlugin" message="tns:IUpdateLocation_GetPackedPlugin_InputMessage" />
    213       <wsdl:output wsaw:Action="http://tempuri.org/IUpdateLocation/GetPackedPluginResponse" message="tns:IUpdateLocation_GetPackedPlugin_OutputMessage" />
     207    <wsdl:operation name="GetAvailablePluginsByName">
     208      <wsdl:input wsaw:Action="http://tempuri.org/IUpdateLocation/GetAvailablePluginsByName" message="tns:IUpdateLocation_GetAvailablePluginsByName_InputMessage" />
     209      <wsdl:output wsaw:Action="http://tempuri.org/IUpdateLocation/GetAvailablePluginsByNameResponse" message="tns:IUpdateLocation_GetAvailablePluginsByName_OutputMessage" />
     210    </wsdl:operation>
     211    <wsdl:operation name="GetPluginFiles">
     212      <wsdl:input wsaw:Action="http://tempuri.org/IUpdateLocation/GetPluginFiles" message="tns:IUpdateLocation_GetPluginFiles_InputMessage" />
     213      <wsdl:output wsaw:Action="http://tempuri.org/IUpdateLocation/GetPluginFilesResponse" message="tns:IUpdateLocation_GetPluginFiles_OutputMessage" />
    214214    </wsdl:operation>
    215215  </wsdl:portType>
     
    217217    <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_policy" />
    218218    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    219     <wsdl:operation name="GetAvailablePlugins">
    220       <soap12:operation soapAction="http://tempuri.org/IUpdateLocation/GetAvailablePlugins" style="document" />
     219    <wsdl:operation name="GetAvailablePluginsByName">
     220      <soap12:operation soapAction="http://tempuri.org/IUpdateLocation/GetAvailablePluginsByName" style="document" />
    221221      <wsdl:input>
    222         <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetAvailablePlugins_Input_policy" />
     222        <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetAvailablePluginsByName_Input_policy" />
    223223        <soap12:body use="literal" />
    224224      </wsdl:input>
    225225      <wsdl:output>
    226         <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetAvailablePlugins_output_policy" />
     226        <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetAvailablePluginsByName_output_policy" />
    227227        <soap12:body use="literal" />
    228228      </wsdl:output>
    229229    </wsdl:operation>
    230     <wsdl:operation name="GetPackedPlugin">
    231       <soap12:operation soapAction="http://tempuri.org/IUpdateLocation/GetPackedPlugin" style="document" />
     230    <wsdl:operation name="GetPluginFiles">
     231      <soap12:operation soapAction="http://tempuri.org/IUpdateLocation/GetPluginFiles" style="document" />
    232232      <wsdl:input>
    233         <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetPackedPlugin_Input_policy" />
     233        <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetPluginFiles_Input_policy" />
    234234        <soap12:body use="literal" />
    235235      </wsdl:input>
    236236      <wsdl:output>
    237         <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetPackedPlugin_output_policy" />
     237        <wsp:PolicyReference URI="#WSHttpBinding_IUpdateLocation_GetPluginFiles_output_policy" />
    238238        <soap12:body use="literal" />
    239239      </wsdl:output>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Service References/UpdateLocationReference/UpdateLocation.xsd

    r2517 r2527  
    22<xs:schema xmlns:tns="http://tempuri.org/" elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    33  <xs:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Update.Service" />
    4   <xs:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd4" namespace="http://schemas.microsoft.com/Message" />
    5   <xs:element name="GetAvailablePlugins">
    6     <xs:complexType>
    7       <xs:sequence />
    8     </xs:complexType>
    9   </xs:element>
    10   <xs:element name="GetAvailablePluginsResponse">
     4  <xs:import schemaLocation="http://localhost:59253/UpdateLocation.svc?xsd=xsd4" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
     5  <xs:element name="GetAvailablePluginsByName">
    116    <xs:complexType>
    127      <xs:sequence>
    13         <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/HeuristicLab.Update.Service" minOccurs="0" name="GetAvailablePluginsResult" nillable="true" type="q1:ArrayOfPluginInformation" />
     8        <xs:element minOccurs="0" name="name" nillable="true" type="xs:string" />
    149      </xs:sequence>
    1510    </xs:complexType>
    1611  </xs:element>
    17   <xs:element name="GetPackedPlugin">
     12  <xs:element name="GetAvailablePluginsByNameResponse">
     13    <xs:complexType>
     14      <xs:sequence>
     15        <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/HeuristicLab.Update.Service" minOccurs="0" name="GetAvailablePluginsByNameResult" nillable="true" type="q1:ArrayOfPluginInformation" />
     16      </xs:sequence>
     17    </xs:complexType>
     18  </xs:element>
     19  <xs:element name="GetPluginFiles">
    1820    <xs:complexType>
    1921      <xs:sequence>
     
    2224    </xs:complexType>
    2325  </xs:element>
    24   <xs:element name="GetPackedPluginResponse">
     26  <xs:element name="GetPluginFilesResponse">
    2527    <xs:complexType>
    2628      <xs:sequence>
    27         <xs:element xmlns:q3="http://schemas.microsoft.com/Message" name="GetPackedPluginResult" type="q3:StreamBody" />
     29        <xs:element xmlns:q3="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="GetPluginFilesResult" nillable="true" type="q3:ArrayOfbase64Binary" />
    2830      </xs:sequence>
    2931    </xs:complexType>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Service References/UpdateLocationReference/UpdateLocation4.xsd

    r2517 r2527  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <xs:schema xmlns:tns="http://schemas.microsoft.com/Message" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/Message" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    3   <xs:simpleType name="StreamBody">
    4     <xs:restriction base="xs:base64Binary" />
    5   </xs:simpleType>
     2<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema">
     3  <xs:complexType name="ArrayOfbase64Binary">
     4    <xs:sequence>
     5      <xs:element minOccurs="0" maxOccurs="unbounded" name="base64Binary" nillable="true" type="xs:base64Binary" />
     6    </xs:sequence>
     7  </xs:complexType>
     8  <xs:element name="ArrayOfbase64Binary" nillable="true" type="tns:ArrayOfbase64Binary" />
    69</xs:schema>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/SplashScreen.Designer.cs

    r2504 r2527  
    2121
    2222using HeuristicLab.PluginInfrastructure;
    23 namespace HeuristicLab.PluginInfrastructure {
     23namespace HeuristicLab.PluginInfrastructure.Starter {
    2424  partial class SplashScreen {
    2525    /// <summary>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/SplashScreen.cs

    r2506 r2527  
    3030using HeuristicLab.PluginInfrastructure.Manager;
    3131
    32 namespace HeuristicLab.PluginInfrastructure {
     32namespace HeuristicLab.PluginInfrastructure.Starter {
    3333  internal partial class SplashScreen : Form {
    3434    private const int FADE_INTERVAL = 50;
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/StarterForm.Designer.cs

    r2507 r2527  
    2020#endregion
    2121
    22 namespace HeuristicLab.PluginInfrastructure {
     22namespace HeuristicLab.PluginInfrastructure.Starter {
    2323  partial class StarterForm {
    2424    /// <summary>
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/StarterForm.cs

    r2513 r2527  
    3434using System.IO;
    3535
    36 namespace HeuristicLab.PluginInfrastructure {
     36namespace HeuristicLab.PluginInfrastructure.Starter {
    3737  public partial class StarterForm : Form {
    3838
     
    4545      InitializeComponent();
    4646
    47       string pluginPath = Path.GetFullPath(HeuristicLab.PluginInfrastructure.Properties.Settings.Default.PluginDir);
     47      string pluginPath = Path.GetFullPath(Application.StartupPath);     
    4848      pluginManager = new PluginManager(pluginPath);
    4949      SplashScreen splashScreen = new SplashScreen(pluginManager, 1000, "Loading HeuristicLab...");
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/app.config

    r2517 r2527  
    88    <applicationSettings>
    99        <HeuristicLab.PluginInfrastructure.Properties.Settings>
    10             <setting name="PluginDir" serializeAs="String">
    11                 <value>plugins</value>
    12             </setting>
    1310            <setting name="User" serializeAs="String">
    14                 <value />
     11                <value>Gabriel Kronberger</value>
    1512            </setting>
    1613            <setting name="Organization" serializeAs="String">
    17                 <value />
     14                <value>HEAL</value>
     15            </setting>
     16            <setting name="UpdateLocations" serializeAs="Xml">
     17                <value>
     18                    <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     19                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     20                        <string>http://localhost:59253/UpdateLocation.svc</string>
     21                    </ArrayOfString>
     22                </value>
    1823            </setting>
    1924        </HeuristicLab.PluginInfrastructure.Properties.Settings>
Note: See TracChangeset for help on using the changeset viewer.