Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/30/09 12:46:32 (16 years ago)
Author:
vdorfer
Message:

Created parts of the API documentation for HeuristicLab.PluginInfrastructure namespace (#331)

Location:
trunk/sources/HeuristicLab.PluginInfrastructure
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/ApplicationInfo.cs

    r242 r1189  
    2525
    2626namespace HeuristicLab.PluginInfrastructure {
     27  /// <summary>
     28  /// Class that provides information about an application.
     29  /// </summary>
    2730  [Serializable]
    2831  public class ApplicationInfo {
    2932    private string name;
    3033
     34    /// <summary>
     35    /// Gets or sets the name of the application.
     36    /// </summary>
    3137    public string Name {
    3238      get { return name; }
     
    3541    private Version version;
    3642
     43    /// <summary>
     44    /// Gets or sets the version of the application.
     45    /// </summary>
    3746    public Version Version {
    3847      get { return version; }
     
    4150    private string description;
    4251
     52    /// <summary>
     53    /// Gets or sets the description of the application.
     54    /// </summary>
    4355    public string Description {
    4456      get { return description; }
     
    4759
    4860    private bool autoRestart;
     61    /// <summary>
     62    /// Gets or sets the boolean flag if the application should be automatically restarted.
     63    /// </summary>
    4964    public bool AutoRestart {
    5065      get { return autoRestart; }
     
    5469    private string pluginAssembly;
    5570    /// <summary>
    56     /// Name of the assembly that contains the IApplication type.
     71    /// Gets or sets the name of the assembly that contains the IApplication type.
    5772    /// </summary>
    5873    public string PluginAssembly {
     
    6378    private string pluginType;
    6479    /// <summary>
    65     /// Name of the type that implements the interface IApplication.
     80    /// Gets or sets the name of the type that implements the interface IApplication.
    6681    /// </summary>
    6782    public string PluginType {
  • trunk/sources/HeuristicLab.PluginInfrastructure/AssemblyBuildDateAttribute.cs

    r91 r1189  
    2626
    2727namespace HeuristicLab.PluginInfrastructure {
     28  /// <summary>
     29  /// Attribute of an assembly when it was built.
     30  /// </summary>
    2831  [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
    2932  public class AssemblyBuildDateAttribute : Attribute {
    3033    private DateTime buildDate;
     34    /// <summary>
     35    /// Gets or sets the date when the assembly has been built.
     36    /// </summary>
    3137    public DateTime BuildDate {
    3238      get { return buildDate; }
    3339      set { buildDate = value; }
    3440    }
     41    /// <summary>
     42    /// Initializes a new instance of <see cref="AssemblyBuildDateAttribute"/> with the given
     43    /// <paramref name="timeStamp"/> as build date.
     44    /// </summary>
     45    /// <exception cref="FormatException">Thrown when the time stamp could not be parsed as build date.</exception>
     46    /// <param name="timeStamp">The build date of the assembly.</param>
    3547    public AssemblyBuildDateAttribute(string timeStamp)
    3648      : base() {
  • trunk/sources/HeuristicLab.PluginInfrastructure/BaseClasses/ApplicationBase.cs

    r242 r1189  
    2626
    2727namespace HeuristicLab.PluginInfrastructure {
     28  /// <summary>
     29  /// Default implementation for the IApplication interface.
     30  /// </summary>
    2831  public abstract class ApplicationBase : IApplication {
    2932    private string name;
     
    3235    private bool autoRestart;
    3336
     37    /// <summary>
     38    /// Initializes a new instance of <see cref="ApplicationBase"/>.
     39    /// </summary>
    3440    public ApplicationBase() {
    3541      ReadAttributes();
     
    7581    #region IApplication Members
    7682
     83    /// <summary>
     84    /// Gets the name of the application.
     85    /// </summary>
    7786    public string Name {
    7887      get { return name; }
    7988    }
    8089
     90    /// <summary>
     91    /// Gets the version of the application.
     92    /// </summary>
    8193    public Version Version {
    8294      get { return version; }
    8395    }
    8496
     97    /// <summary>
     98    /// Gets the description of the application.
     99    /// </summary>
    85100    public string Description {
    86101      get { return description; }
    87102    }
    88103
     104    /// <summary>
     105    /// Gets the boolean flag whether the application should automatically get restarted.
     106    /// </summary>
    89107    public bool AutoRestart {
    90108      get { return autoRestart; }
    91109    }
    92110
     111    /// <summary>
     112    /// Runs the application.
     113    /// </summary>
    93114    public abstract void Run();
    94115
  • trunk/sources/HeuristicLab.PluginInfrastructure/BaseClasses/PluginBase.cs

    r8 r1189  
    3636    private string description;
    3737
     38    /// <summary>
     39    /// Initializes a new instance of <see cref="PluginBase"/>.
     40    /// </summary>
    3841    public PluginBase() {
    3942      ReadAttributes();
     
    8487
    8588    #region IPlugin Members
     89    /// <summary>
     90    /// Gets the name of the plugin.
     91    /// </summary>
    8692    public string Name {
    8793      get {
     
    9096    }
    9197
     98    /// <summary>
     99    /// Gets the version of the plugin.
     100    /// </summary>
    92101    public Version Version {
    93102      get {
     
    96105    }
    97106
     107    /// <summary>
     108    /// Gets the description of the plugin.
     109    /// </summary>
    98110    public string Description {
    99111      get {
     
    102114    }
    103115
     116    /// <inheritdoc/>
    104117    public  string[] Files {
    105118      get {
     
    108121    }
    109122
     123    /// <inheritdoc/>
    110124    public virtual void OnInstall() {
    111125    }
    112126
     127    /// <inheritdoc/>
    113128    public virtual void OnDelete() {
    114129    }
    115130
     131    /// <inheritdoc/>
    116132    public virtual void OnPreUpdate() {
    117133    }
    118134
     135    /// <inheritdoc/>
    119136    public virtual void OnPostUpdate() {
    120137    }
  • trunk/sources/HeuristicLab.PluginInfrastructure/ClassInfoAttribute.cs

    r242 r1189  
    3333    private string name;
    3434    /// <summary>
    35     /// Name of the plugin to which the assembly belongs to.
     35    /// Gets or sets the name of the plugin to which the assembly belongs to.
    3636    /// </summary>
    3737    public string Name {
     
    4141
    4242    private string version;
     43    /// <summary>
     44    /// Gets or sets the version of the plugin.
     45    /// </summary>
    4346    public string Version {
    4447      get { return version; }
     
    4750
    4851    private string description;
     52    /// <summary>
     53    /// Gets or sets the description of the plugin.
     54    /// </summary>
    4955    public string Description {
    5056      get { return description; }
     
    5359
    5460    private bool autoRestart;
     61    /// <summary>
     62    /// Gets or sets the boolean flag whether the plugin should be automatically restarted.
     63    /// </summary>
    5564    public bool AutoRestart {
    5665      get { return autoRestart; }
     
    5867    }
    5968
     69    /// <summary>
     70    /// Initializes a new instance of <see cref="ClassInfoAttribute"/>.
     71    /// </summary>
    6072    public ClassInfoAttribute() {}
    6173  }
  • trunk/sources/HeuristicLab.PluginInfrastructure/DependencyAttribute.cs

    r2 r1189  
    3333
    3434    /// <summary>
    35     /// Name of the plugin that is needed to load the assembly.
     35    /// Gets or sets the name of the plugin that is needed to load the assembly.
    3636    /// </summary>
    3737    public string Dependency {
     
    4040    }
    4141
     42    /// <summary>
     43    /// Initializes a new instance of <see cref="DependencyAttribute"/>.
     44    /// </summary>
    4245    public DependencyAttribute() {
    4346    }
  • trunk/sources/HeuristicLab.PluginInfrastructure/DiscoveryService.cs

    r927 r1189  
    4040
    4141    /// <summary>
    42     ///  Find all types that are subtypes or equal to the specified type.
     42    /// Finds all types that are subtypes or equal to the specified type.
    4343    /// </summary>
    4444    /// <param name="type">Most general type for which to find matching types.</param>
    45     /// <returns></returns>
     45    /// <returns>The found types as array.</returns>
    4646    public Type[] GetTypes(Type type) {
    4747      Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
     
    5656
    5757    /// <summary>
    58     /// Create an instance of all types that are subtypes or the same type of the specified type
     58    /// Creates an instance of all types that are subtypes or the same type of the specified type
    5959    /// </summary>
    6060    /// <typeparam name="T">Most general type.</typeparam>
    61     /// <returns></returns>
     61    /// <returns>The created instances as array.</returns>
    6262    public T[] GetInstances<T>() where T : class {
    6363      Type[] types = GetTypes(typeof(T));
     
    7171    }
    7272
     73    /// <summary>
     74    /// Finds all types that are subtypes or equal to the specified type if they are part of the given
     75    /// <paramref name="plugin"/>.
     76    /// </summary>
     77    /// <param name="type">Most general type for which to find matching types.</param>
     78    /// <param name="plugin">The plugin the subtypes must be part of.</param>
     79    /// <returns>The found types as array.</returns>
    7380    public Type[] GetTypes(Type type, PluginInfo plugin) {
    7481      Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
     
    8693
    8794    /// <summary>
    88     /// Get instances of all types that implement the specified interface only in the given assembly.
     95    /// Gets instances of all types that implement the specified interface only in the given assembly.
    8996    /// </summary>
    9097    /// <typeparam name="T">Interface type.</typeparam>
    9198    /// <param name="assembly">Assembly that should be searched for types.</param>
    92     /// <returns></returns>
     99    /// <returns>The found instances as array.</returns>
    93100    internal T[] GetInstances<T>(Assembly assembly) {
    94101      Type[] types = GetTypes(typeof(T), assembly);
     
    103110
    104111    /// <summary>
    105     /// Get types that are assignable (same of subtype) to the specified type only from the given assembly.
     112    /// Gets types that are assignable (same of subtype) to the specified type only from the given assembly.
    106113    /// </summary>
    107114    /// <param name="type">Most general type we want to find.</param>
    108115    /// <param name="assembly">Assembly that should be searched for types.</param>
    109     /// <returns></returns>
     116    /// <returns>The found types as array.</returns>
    110117    internal Type[] GetTypes(Type type, Assembly assembly) {
    111118      List<Type> types = new List<Type>();
     
    118125    }
    119126
     127    /// <summary>
     128    /// Gets the plugin of the given <paramref name="type"/>.
     129    /// </summary>
     130    /// <param name="type"></param>
     131    /// <returns>The found plugin or <c>null</c>.</returns>
    120132    public PluginInfo GetDeclaringPlugin(Type type) {
    121133      foreach(PluginInfo info in PluginManager.Manager.LoadedPlugins) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/Interfaces/IControl.cs

    r2 r1189  
    2525
    2626namespace HeuristicLab.PluginInfrastructure {
     27  /// <summary>
     28  /// Interface for controls.
     29  /// </summary>
    2730  public interface IControl { }
    2831}
  • trunk/sources/HeuristicLab.PluginInfrastructure/Interfaces/IControlManager.cs

    r2 r1189  
    2626
    2727namespace HeuristicLab.PluginInfrastructure {
     28  /// <summary>
     29  /// Interface for control managers.
     30  /// </summary>
    2831  public interface IControlManager {
     32    /// <summary>
     33    /// Shows the given <paramref name="control"/>.
     34    /// </summary>
     35    /// <param name="control">The control to display.</param>
    2936    void ShowControl(IControl control);
    3037  }
  • trunk/sources/HeuristicLab.PluginInfrastructure/InvalidPluginException.cs

    r96 r1189  
    2525
    2626namespace HeuristicLab.PluginInfrastructure {
     27  /// <summary>
     28  /// Exception class for invalid plugins.
     29  /// </summary>
    2730  class InvalidPluginException : Exception {
    2831  }
  • trunk/sources/HeuristicLab.PluginInfrastructure/Loader.cs

    r535 r1189  
    3030namespace HeuristicLab.PluginInfrastructure {
    3131  internal class Loader : MarshalByRefObject {
     32    /// <summary>
     33    /// Event handler for loaded plugins.
     34    /// </summary>
     35    /// <param name="pluginName">The plugin that has been loaded.</param>
    3236    public delegate void PluginLoadedEventHandler(string pluginName);
     37   
    3338    public delegate void PluginLoadFailedEventHandler(string pluginName, string args);
    3439
     
    9196    /// list of assemblies of an plugin and the list of dependencies for each of those assemblies
    9297    /// </summary>
     98    /// <exception cref="FileLoadException">Thrown when the file could not be loaded.</exception>
    9399    internal void Init() {
    94100      AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += delegate(object sender, ResolveEventArgs args) {
     
    386392    }
    387393
    388     // infinite lease time
     394    /// <summary>
     395    /// Initializes the life time service with an infinte lease time.
     396    /// </summary>
     397    /// <returns><c>null</c>.</returns>
    389398    public override object InitializeLifetimeService() {
    390399      return null;
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginFileAttribute.cs

    r5 r1189  
    2525
    2626namespace HeuristicLab.PluginInfrastructure {
     27  /// <summary>
     28  /// Enumerator of available file types for a plugin.
     29  /// </summary>
    2730  public enum PluginFileType {
    2831    Assembly,
     
    3235  };
    3336
     37  /// <summary>
     38  /// Attribute for plugins providing information about their corresponding files.
     39  /// </summary>
    3440  [AttributeUsage(AttributeTargets.Class, AllowMultiple=true)]
    3541  public class PluginFileAttribute : System.Attribute {
    3642    private string filename;
    3743
     44    /// <summary>
     45    /// Gets or sets the filename of the plugin.
     46    /// </summary>
    3847    public string Filename {
    3948      get { return filename; }
     
    4352    private PluginFileType filetype = PluginFileType.Data;
    4453
     54    /// <summary>
     55    /// Gets or sets the filetype of the plugin file.
     56    /// </summary>
    4557    public PluginFileType Filetype {
    4658      get { return filetype; }
     
    4860    }
    4961
     62    /// <summary>
     63    /// Initializes a new instance of <see cref="PluginFileAttribute"/>.
     64    /// </summary>
    5065    public PluginFileAttribute() { }
    5166  }
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginInfo.cs

    r91 r1189  
    3232  public class PluginInfo {
    3333    private string name;
     34    /// <summary>
     35    /// Gets or sets the name of the plugin.
     36    /// </summary>
    3437    public string Name {
    3538      get { return name; }
     
    3740    }
    3841    private Version version;
     42    /// <summary>
     43    /// Gets or sets the version of the plugin.
     44    /// </summary>
    3945    public Version Version {
    4046      get { return version; }
     
    4248    }
    4349    private DateTime buildDate;
     50    /// <summary>
     51    /// Gets or sets the build date of the plugin.
     52    /// </summary>
    4453    public DateTime BuildDate {
    4554      get { return buildDate; }
     
    4857    private List<string> files = new List<string>();
    4958    /// <summary>
    50     /// Names of all files that belong to this plugin.
     59    /// Gets the names of all files that belong to this plugin.
    5160    /// These files are deleted when the plugin is removed or updated.
    5261    /// </summary>
     
    5665
    5766    private List<PluginInfo> dependencies = new List<PluginInfo>();
     67    /// <summary>
     68    /// Gets all dependencies of the plugin.
     69    /// </summary>
    5870    public List<PluginInfo> Dependencies {
    5971      get { return dependencies; }
     
    6173    private List<string> assemblies = new List<string>();
    6274    /// <summary>
    63     /// Names of the assemblies that belong to this plugin.
     75    /// Gets the names of the assemblies that belong to this plugin.
    6476    /// </summary>
    6577    public List<string> Assemblies {
     
    6880    }
    6981    private string message;
     82    /// <summary>
     83    /// Gets or sets the message.
     84    /// </summary>
    7085    public string Message {
    7186      get { return message; }
    7287      set { message = value; }
    7388    }
     89    /// <summary>
     90    /// Gets the string representation of the plugin.
     91    /// </summary>
     92    /// <returns>The name of the plugin.</returns>
    7493    public override string ToString() {
    7594      return Name;
    7695    }
     96   
    7797    // equals and hashcode have to be implemented because we want to compare PluginDescriptions from
    7898    // different AppDomains and serialization destroys reference equality
     99    /// <summary>
     100    /// Checks whether the given object is equal to the current plugin.
     101    /// </summary>
     102    /// <param name="obj">The object to compare.</param>
     103    /// <returns><c>true</c> if it is equal, <c>false</c> otherwise.</returns>
    79104    public override bool Equals(object obj) {
    80105      if(!(obj is PluginInfo))
     
    84109      return other.Name == this.Name && other.Version == this.Version;
    85110    }
     111    /// <summary>
     112    /// Gets the hash code of the current plugin.
     113    /// </summary>
     114    /// <returns>The hash code of the plugin.</returns>
    86115    public override int GetHashCode() {
    87116      if(version != null) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginManager.cs

    r997 r1189  
    3131
    3232  // must extend MarshalByRefObject because of event passing between Loader and PluginManager (each in it's own AppDomain)
     33  /// <summary>
     34  /// Class to manage different plugins.
     35  /// </summary>
    3336  public class PluginManager : MarshalByRefObject {
    3437
    3538    // singleton: only one manager allowed in each AppDomain
    3639    private static PluginManager manager = new PluginManager();
     40    /// <summary>
     41    /// Gets the plugin manager (is a singleton).
     42    /// </summary>
    3743    public static PluginManager Manager {
    3844      get { return manager; }
     
    4147    // singleton: only one control manager allowed in each applicatoin (i.e. AppDomain)
    4248    private static IControlManager controlManager;
     49    /// <summary>
     50    /// Gets or sets the control manager (is a singleton).
     51    /// </summary>
    4352    public static IControlManager ControlManager {
    4453      get { return controlManager; }
     
    4655    }
    4756
     57    /// <summary>
     58    /// Event handler for actions in the plugin manager.
     59    /// </summary>
    4860    public event PluginManagerActionEventHandler Action;
    4961
     
    5870    }
    5971
     72    /// <summary>
     73    /// Gets all installed plugins.
     74    /// </summary>
     75    /// <remarks>This information is provided by a <see cref="Loader"/>.</remarks>
    6076    public ICollection<PluginInfo> InstalledPlugins {
    6177      get { return remoteLoader.InstalledPlugins; }
    6278    }
    6379
     80    /// <summary>
     81    /// Gets all disabled plugins.
     82    /// </summary>
     83    /// <remarks>This information is provided by a <see cref="Loader"/>.</remarks>
    6484    public ICollection<PluginInfo> DisabledPlugins {
    6585      get { return remoteLoader.DisabledPlugins; }
    6686    }
    6787
     88    /// <summary>
     89    /// Gets all active plugins.
     90    /// </summary>
     91    /// <remarks>This information is provided by a <see cref="Loader"/>.</remarks>
    6892    public ICollection<PluginInfo> ActivePlugins {
    6993      get { return remoteLoader.ActivePlugins; }
    7094    }
    7195
     96    /// <summary>
     97    /// Gets all installed applications.
     98    /// </summary>
     99    /// <remarks>This information is provided by a <see cref="Loader"/>.</remarks>
    72100    public ICollection<ApplicationInfo> InstalledApplications {
    73101      get { return remoteLoader.InstalledApplications; }
     
    75103
    76104    private ICollection<PluginInfo> loadedPlugins;
     105    /// <summary>
     106    /// Gets or (internally) sets the loaded plugins.
     107    /// </summary>
    77108    public ICollection<PluginInfo> LoadedPlugins {
    78109      get { return loadedPlugins; }
     
    138169
    139170    /// <summary>
    140     /// Creates a new AppDomain with all plugins preloaded and Sandboxing capability
     171    /// Creates a new AppDomain with all plugins preloaded and Sandboxing capability.
    141172    /// </summary>
    142173    /// <param name="assembly">Assembly reference</param>
     
    202233    /// Calculates a set of plugins that directly or transitively depend on the plugin given in the argument.
    203234    /// </summary>
    204     /// <param name="pluginInfo"></param>
     235    /// <param name="pluginInfo">The plugin the other depend on.</param>
    205236    /// <returns>a list of plugins that are directly of transitively dependent.</returns>
    206237    public List<PluginInfo> GetDependentPlugins(PluginInfo pluginInfo) {
     
    223254    }
    224255
     256    /// <summary>
     257    /// Unloads all plugins.
     258    /// </summary>
    225259    public void UnloadAllPlugins() {
    226260      AppDomain.Unload(pluginDomain);
    227261    }
    228262
     263    /// <summary>
     264    /// Loads all plugins.
     265    /// </summary>
    229266    public void LoadAllPlugins() {
    230267      Initialize();
    231268    }
    232269
     270    /// <inheritdoc cref="Loader.OnDelete"/>
    233271    public void OnDelete(PluginInfo pluginInfo) {
    234272      remoteLoader.OnDelete(pluginInfo);
    235273    }
    236274
     275    /// <inheritdoc cref="Loader.OnInstall"/>
    237276    public void OnInstall(PluginInfo pluginInfo) {
    238277      remoteLoader.OnInstall(pluginInfo);
    239278    }
    240279
     280    /// <inheritdoc cref="Loader.OnPreUpdate"/>
    241281    public void OnPreUpdate(PluginInfo pluginInfo) {
    242282      remoteLoader.OnPreUpdate(pluginInfo);
    243283    }
    244284
     285    /// <inheritdoc cref="Loader.OnPostUpdate"/>
    245286    public void OnPostUpdate(PluginInfo pluginInfo) {
    246287      remoteLoader.OnPostUpdate(pluginInfo);
  • trunk/sources/HeuristicLab.PluginInfrastructure/PluginManagerActionEventArgs.cs

    r2 r1189  
    2525
    2626namespace HeuristicLab.PluginInfrastructure {
     27  /// <summary>
     28  /// Enum for all possible actions the plugin manager can execute.
     29  /// </summary>
    2730  public enum PluginManagerAction { Initializing, InitializingPlugin, InitializedPlugin, Initialized, Starting }
     31  /// <summary>
     32  /// Event handler for all action events of the plugin manager.
     33  /// </summary>
     34  /// <param name="sender">The sender of the action event.</param>
     35  /// <param name="e">The event arguments.</param>
    2836  public delegate void PluginManagerActionEventHandler(object sender, PluginManagerActionEventArgs e);
    2937
    3038  // this class must be serializable because EventArgs are transmitted over AppDomain boundaries
     39  /// <summary>
     40  /// Class for the event arguments of plugin manager action events.
     41  /// </summary>
    3142  [Serializable]
    3243  public class PluginManagerActionEventArgs {
    3344    private PluginManagerAction action;
     45    /// <summary>
     46    /// Gets or sets the action that has been performed.
     47    /// </summary>
    3448    public PluginManagerAction Action {
    3549      get { return action; }
     
    3751    }
    3852    private string id;
     53    /// <summary>
     54    /// Gets or sets the id of the action event arguments.
     55    /// </summary>
    3956    public string Id {
    4057      get { return id; }
     
    4259    }
    4360
     61    /// <summary>
     62    /// Initializes a new instance of <see cref="PluginManagerActionEventArgs"/> with the given
     63    /// <paramref name="id"/> and <paramref name="action"/>.
     64    /// </summary>
     65    /// <param name="id">The id of the action event arguments.</param>
     66    /// <param name="action">The action of the plugin manager.</param>
    4467    public PluginManagerActionEventArgs(string id, PluginManagerAction action) {
    4568      this.Id = id;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Runner.cs

    r997 r1189  
    4848
    4949    // infinite lease time
     50    /// <summary>
     51    /// Initializes the life time service with infinite lease time.
     52    /// </summary>
     53    /// <returns><c>null</c>.</returns>
    5054    public override object InitializeLifetimeService() {
    5155      return null;
Note: See TracChangeset for help on using the changeset viewer.