[2488] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[2790] | 3 | * Copyright (C) 2002-2010 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 |
|
---|
| 22 | using System;
|
---|
| 23 | using System.Collections.Generic;
|
---|
| 24 | using System.Text;
|
---|
| 25 | using System.Windows.Forms;
|
---|
| 26 | using System.Reflection;
|
---|
| 27 |
|
---|
| 28 | namespace HeuristicLab.PluginInfrastructure {
|
---|
| 29 | /// <summary>
|
---|
| 30 | /// Interface for application managers.
|
---|
| 31 | /// </summary>
|
---|
| 32 | public interface IApplicationManager {
|
---|
[2504] | 33 | /// <summary>
|
---|
| 34 | /// Gets all discovered plugins.
|
---|
| 35 | /// </summary>
|
---|
[2488] | 36 | IEnumerable<IPluginDescription> Plugins { get; }
|
---|
[2642] | 37 |
|
---|
[2504] | 38 | /// <summary>
|
---|
| 39 | /// Gets all discovered applications.
|
---|
| 40 | /// </summary>
|
---|
[2488] | 41 | IEnumerable<IApplicationDescription> Applications { get; }
|
---|
| 42 |
|
---|
[2504] | 43 | /// <summary>
|
---|
| 44 | /// Discovers and creates instances of <typeparamref name="T"/> and all types implementing or inheriting <typeparamref name="T"/> (directly and indirectly).
|
---|
| 45 | /// </summary>
|
---|
| 46 | /// <typeparam name="T">The type or super-type to discover.</typeparam>
|
---|
| 47 | /// <returns>An enumerable of instances of the discovered types.</returns>
|
---|
[2488] | 48 | IEnumerable<T> GetInstances<T>() where T : class;
|
---|
| 49 |
|
---|
[2504] | 50 | /// <summary>
|
---|
[2592] | 51 | /// Discovers and creates instances of <paramref name="type"/> and all types implementing or inheriting <paramref name="type"/> (directly and indirectly).
|
---|
| 52 | /// </summary>
|
---|
[3092] | 53 | /// <param name="type">The type or super-type to discover.</param>
|
---|
[2592] | 54 | /// <returns>An enumerable of instances of the discovered types.</returns>
|
---|
| 55 | IEnumerable<object> GetInstances(Type type);
|
---|
| 56 |
|
---|
| 57 | /// <summary>
|
---|
[2504] | 58 | /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly).
|
---|
| 59 | /// </summary>
|
---|
| 60 | /// <param name="type">The type to discover.</param>
|
---|
| 61 | /// <returns>An enumerable of discovered types.</returns>
|
---|
[2488] | 62 | IEnumerable<Type> GetTypes(Type type);
|
---|
[2642] | 63 |
|
---|
[2504] | 64 | /// <summary>
|
---|
[2642] | 65 | /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly).
|
---|
| 66 | /// </summary>
|
---|
| 67 | /// <param name="type">The type to discover.</param>
|
---|
| 68 | /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
|
---|
| 69 | /// <returns>An enumerable of discovered types.</returns>
|
---|
| 70 | IEnumerable<Type> GetTypes(Type type, bool onlyInstantiable);
|
---|
| 71 |
|
---|
| 72 | /// <summary>
|
---|
[2504] | 73 | /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly) that are declaed in any assembly of <paramref name="plugin"/>.
|
---|
| 74 | /// </summary>
|
---|
| 75 | /// <param name="type">The type to discover.</param>
|
---|
| 76 | /// <param name="plugin">The declaring plugin.</param>
|
---|
| 77 | /// <returns>An enumerable of discovered types.</returns>
|
---|
| 78 | IEnumerable<Type> GetTypes(Type type, IPluginDescription plugin);
|
---|
[2642] | 79 |
|
---|
[2592] | 80 | /// <summary>
|
---|
[2642] | 81 | /// Discovers all types implementing or inheriting <paramref name="type"/> (directly and indirectly) that are declaed in any assembly of <paramref name="plugin"/>.
|
---|
| 82 | /// </summary>
|
---|
| 83 | /// <param name="type">The type to discover.</param>
|
---|
| 84 | /// <param name="plugin">The declaring plugin.</param>
|
---|
| 85 | /// <param name="onlyInstantiable">Return only types that are instantiable (instance, abstract... are not returned)</param>
|
---|
| 86 | /// <returns>An enumerable of discovered types.</returns>
|
---|
| 87 | IEnumerable<Type> GetTypes(Type type, IPluginDescription plugin, bool onlyInstantiable);
|
---|
| 88 |
|
---|
| 89 | /// <summary>
|
---|
[2592] | 90 | /// Finds the plugin that declares the <paramref name="type">type</paramref>.
|
---|
| 91 | /// </summary>
|
---|
| 92 | /// <param name="type">The type of interest.</param>
|
---|
| 93 | /// <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>
|
---|
| 94 | IPluginDescription GetDeclaringPlugin(Type type);
|
---|
[2488] | 95 | }
|
---|
| 96 | }
|
---|