Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.PluginInfrastructure/3.3/Interfaces/IApplicationManager.cs @ 17181

Last change on this file since 17181 was 17181, checked in by swagner, 5 years ago

#2875: Merged r17180 from trunk to stable

File size: 6.7 KB
RevLine 
[2488]1#region License Information
2/* HeuristicLab
[17181]3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[2488]4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
[11922]24using System.Reflection;
[2488]25
26namespace HeuristicLab.PluginInfrastructure {
27  /// <summary>
28  /// Interface for application managers.
29  /// </summary>
30  public interface IApplicationManager {
[2504]31    /// <summary>
32    /// Gets all discovered plugins.
33    /// </summary>
[2488]34    IEnumerable<IPluginDescription> Plugins { get; }
[2642]35
[2504]36    /// <summary>
37    /// Gets all discovered applications.
38    /// </summary>
[2488]39    IEnumerable<IApplicationDescription> Applications { get; }
40
[2504]41    /// <summary>
42    /// Discovers and creates instances of <typeparamref name="T"/> and all types implementing or inheriting <typeparamref name="T"/> (directly and indirectly).
43    /// </summary>
44    /// <typeparam name="T">The type or super-type to discover.</typeparam>
45    /// <returns>An enumerable of instances of the discovered types.</returns>
[2488]46    IEnumerable<T> GetInstances<T>() where T : class;
47
[2504]48    /// <summary>
[2592]49    /// Discovers and creates instances of <paramref name="type"/> and all types implementing or inheriting <paramref name="type"/> (directly and indirectly).
50    /// </summary>
[3092]51    /// <param name="type">The type or super-type to discover.</param>
[2592]52    /// <returns>An enumerable of instances of the discovered types.</returns>
53    IEnumerable<object> GetInstances(Type type);
54
55    /// <summary>
[2504]56    /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly).
57    /// </summary>
58    /// <param name="type">The type to discover.</param>
[5850]59    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
[2504]60    /// <returns>An enumerable of discovered types.</returns>
[7111]61    IEnumerable<Type> GetTypes(Type type, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false);
[2642]62
[2504]63    /// <summary>
[5850]64    /// Discovers all types implementing or inheriting all or any type in <paramref name="types"/> (directly and indirectly).
[2642]65    /// </summary>
[5850]66    /// <param name="types">The types to discover.</param>
[2642]67    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
[5903]68    /// <param name="assignableToAllTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
[2642]69    /// <returns>An enumerable of discovered types.</returns>
[7111]70    IEnumerable<Type> GetTypes(IEnumerable<Type> types, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false, bool assignableToAllTypes = true);
[2642]71
72    /// <summary>
[11922]73    /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly) that are declared in any assembly of <paramref name="plugin"/>.
[2504]74    /// </summary>
75    /// <param name="type">The type to discover.</param>
76    /// <param name="plugin">The declaring plugin.</param>
[5850]77    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
[2504]78    /// <returns>An enumerable of discovered types.</returns>
[7111]79    IEnumerable<Type> GetTypes(Type type, IPluginDescription plugin, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false);
[2642]80
[2592]81    /// <summary>
[11922]82    /// Discovers all types implementing or inheriting all or any type in <paramref name="types"/> (directly and indirectly) that are declared in any assembly of <paramref name="plugin"/>.
[2642]83    /// </summary>
[5850]84    /// <param name="types">The types to discover.</param>
[2642]85    /// <param name="plugin">The declaring plugin.</param>
86    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
[5903]87    /// /// <param name="assignableToAllTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
[2642]88    /// <returns>An enumerable of discovered types.</returns>
[7111]89    IEnumerable<Type> GetTypes(IEnumerable<Type> types, IPluginDescription plugin, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false, bool assignableToAllTypes = true);
[2642]90
[11922]91
[2642]92    /// <summary>
[11922]93    /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly) that are declared in the<paramref name="assembly"/>.
94    /// </summary>
95    /// <param name="type">The type to discover.</param>
96    /// <param name="assembly">The declaring assembly.</param>
97    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
98    /// <returns>An enumerable of discovered types.</returns>
99    IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false);
100
101    /// <summary>
102    /// Discovers all types implementing or inheriting all or any type in <paramref name="types"/> (directly and indirectly) that are declaed in any assembly of <paramref name="plugin"/>.
103    /// </summary>
104    /// <param name="types">The types to discover.</param>
105    /// <param name="assembly">The declaring assembly.</param>
106    /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
107    /// /// <param name="assignableToAllTypes">Specifies if discovered types must implement or inherit all given <paramref name="types"/>.</param>
108    /// <returns>An enumerable of discovered types.</returns>
109    IEnumerable<Type> GetTypes(IEnumerable<Type> types, Assembly assembly, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false, bool assignableToAllTypes = true);
110
111    /// <summary>
[2592]112    /// Finds the plugin that declares the <paramref name="type">type</paramref>.
113    /// </summary>
114    /// <param name="type">The type of interest.</param>
115    /// <returns>The description of the plugin that declares the given type or null if the type has not been declared by a known plugin.</returns>
116    IPluginDescription GetDeclaringPlugin(Type type);
[2488]117  }
118}
Note: See TracBrowser for help on using the repository browser.