Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/20/09 16:35:13 (15 years ago)
Author:
gkronber
Message:

Worked on plugin installation manager and update location service. #799

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Manager/DefaultApplicationManager.cs

    r2504 r2517  
    8080    private void LoadPlugins(IEnumerable<PluginDescription> plugins) {
    8181      // load all loadable plugins (all dependencies available) into the execution context
    82       foreach (var desc in PluginDescriptionIterator.IterateInDependencyOrder(plugins.Where(x => x.PluginState != PluginState.Disabled))) {
     82      foreach (var desc in PluginDescriptionIterator.IterateDependenciesBottomUp(plugins.Where(x => x.PluginState != PluginState.Disabled))) {
    8383        foreach (string assembly in desc.Assemblies) {
    8484          var asm = Assembly.LoadFrom(assembly);
     
    105105          plugin.OnUnload();
    106106        }
    107         foreach (var desc in PluginDescriptionIterator.IterateInDependencyOrder(plugins.Where(x => x.PluginState != PluginState.Disabled))) {
     107        foreach (var desc in PluginDescriptionIterator.IterateDependenciesBottomUp(plugins.Where(x => x.PluginState != PluginState.Disabled))) {
    108108          desc.Unload();
    109109          OnPluginUnloaded(new PluginInfrastructureEventArgs("Plugin unloaded", desc));
     
    134134    /// <typeparam name="T">Most general type.</typeparam>
    135135    /// <returns>Enumerable of the created instances.</returns>
    136     public IEnumerable<T> GetInstances<T>(IPluginDescription plugin) where T : class {
     136    public static IEnumerable<T> GetInstances<T>(IPluginDescription plugin) where T : class {
    137137      return from t in GetTypes(typeof(T), plugin)
    138138             where !t.IsAbstract && !t.IsInterface && !t.HasElementType
     
    155155    /// <typeparam name="T">Most general type.</typeparam>
    156156    /// <returns>Enumerable of the created instances.</returns>
    157     public IEnumerable<T> GetInstances<T>() where T : class {
     157    public static IEnumerable<T> GetInstances<T>() where T : class {
    158158      return from i in GetInstances(typeof(T))
    159159             select (T)i;
     
    165165    /// <typeparam name="type">Most general type.</typeparam>
    166166    /// <returns>Enumerable of the created instances.</returns>
    167     public IEnumerable<object> GetInstances(Type type) {
     167    public static IEnumerable<object> GetInstances(Type type) {
    168168      return from t in GetTypes(type)
    169169             where !t.IsAbstract && !t.IsInterface && !t.HasElementType
     
    176176    /// <param name="type">Most general type for which to find matching types.</param>
    177177    /// <returns>Enumerable of the discovered types.</returns>
    178     public IEnumerable<Type> GetTypes(Type type) {
     178    public static IEnumerable<Type> GetTypes(Type type) {
    179179      return from asm in AppDomain.CurrentDomain.GetAssemblies()
    180180             from t in GetTypes(type, asm)
     
    189189    /// <param name="plugin">The plugin the subtypes must be part of.</param>
    190190    /// <returns>Enumerable of the discovered types.</returns>
    191     public IEnumerable<Type> GetTypes(Type type, IPluginDescription pluginDescription) {
     191    public static IEnumerable<Type> GetTypes(Type type, IPluginDescription pluginDescription) {
    192192      PluginDescription pluginDesc = (PluginDescription)pluginDescription;
    193193      return from asm in AppDomain.CurrentDomain.GetAssemblies()
     
    225225      return null;
    226226    }
     227
     228    #region IApplicationManager Members
     229
     230
     231    IEnumerable<T> IApplicationManager.GetInstances<T>(IPluginDescription plugin) {
     232      return GetInstances<T>(plugin);
     233    }
     234
     235    IEnumerable<T> IApplicationManager.GetInstances<T>() {
     236      return GetInstances<T>();
     237    }
     238
     239    IEnumerable<Type> IApplicationManager.GetTypes(Type type) {
     240      return GetTypes(type);
     241    }
     242
     243    IEnumerable<Type> IApplicationManager.GetTypes(Type type, IPluginDescription plugin) {
     244      return GetTypes(type, plugin);
     245    }
     246
     247    #endregion
    227248  }
    228249}
Note: See TracChangeset for help on using the changeset viewer.