Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/26/09 13:40:08 (16 years ago)
Author:
gkronber
Message:

Implemented #471 (OnLoad hook for plugins).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.PluginInfrastructure/BaseClasses/PluginBase.cs

    r8 r1228  
    3030  /// Default implementation of the IPlugin interface.
    3131  /// </summary>
    32   public class PluginBase : IPlugin {
     32  public abstract class PluginBase : IPlugin {
    3333    private string name;
    3434    private Version version;
     
    4444
    4545      // exactly one attribute of the type ClassInfoAttribute must be given
    46       if(pluginAttributes.Length != 1) {
     46      if (pluginAttributes.Length != 1) {
    4747        throw new InvalidPluginException();
    4848      }
     
    5252
    5353      // if the plugin name is not explicitly set in the attribute then the default plugin name is the FullName of the type
    54       if(pluginAttribute != null && pluginAttribute.Name != null) {
     54      if (pluginAttribute != null && pluginAttribute.Name != null) {
    5555        this.name = pluginAttribute.Name;
    5656      } else {
     
    5959
    6060      // if the version is not explicitly set in the attribute then the version of the assembly is used as default
    61       if(pluginAttribute != null && pluginAttribute.Version != null) {
     61      if (pluginAttribute != null && pluginAttribute.Version != null) {
    6262        this.version = new Version(pluginAttribute.Version);
    6363      } else {
     
    6666
    6767      // if the description is not explicitly set in the attribute then the name of name of the plugin is used as default
    68       if(pluginAttribute != null && pluginAttribute.Description != null) {
     68      if (pluginAttribute != null && pluginAttribute.Description != null) {
    6969        this.description = pluginAttribute.Description;
    7070      } else {
     
    7878      this.files = new string[fileAttributes.Length];
    7979      int i = 0;
    80       foreach(PluginFileAttribute fileAttr in fileAttributes) {
     80      foreach (PluginFileAttribute fileAttr in fileAttributes) {
    8181        files[i++] = fileAttr.Filename;
    8282      }
     
    102102    }
    103103
    104     public  string[] Files {
     104    public string[] Files {
    105105      get {
    106106        return files;
     
    108108    }
    109109
    110     public virtual void OnInstall() {
    111     }
    112 
    113     public virtual void OnDelete() {
    114     }
    115 
    116     public virtual void OnPreUpdate() {
    117     }
    118 
    119     public virtual void OnPostUpdate() {
    120     }
     110    public virtual void OnLoad() { }
     111    public virtual void OnInstall() { }
     112    public virtual void OnDelete() { }
     113    public virtual void OnPreUpdate() { }
     114    public virtual void OnPostUpdate() { }
    121115
    122116    #endregion
Note: See TracChangeset for help on using the changeset viewer.