Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/09 18:33:30 (15 years ago)
Author:
gkronber
Message:

Worked on core of plugin infrastructure.

  • Collected all classes into a single assembly (HL.PluginInfrastructure)
  • Moved SplashScreen and MainForm from HeuristicLab.exe project into the plugin infrastructure.
  • Introduced namespaces
  • Added strict access modifiers (internal)
  • Fixed most FxCop warnings in plugin infrastructure core.
  • Fixed issues with plugin load/unload events
  • Deleted empty interface IControl

#799

Location:
branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter
Files:
1 added
6 moved

Legend:

Unmodified
Added
Removed
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/MainForm.Designer.cs

    r2485 r2504  
    2020#endregion
    2121
    22 namespace HeuristicLab {
     22namespace HeuristicLab.PluginInfrastructure {
    2323  partial class MainForm {
    2424    /// <summary>
     
    3232    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    3333    protected override void Dispose(bool disposing) {
    34       if(disposing && (components != null)) {
     34      if (disposing && (components != null)) {
    3535        components.Dispose();
    3636      }
     
    131131      this.detailsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    132132      this.detailsButton.AutoSize = true;
    133       this.detailsButton.Image = global::HeuristicLab.Properties.Resources.Details;
     133      this.detailsButton.Image = HeuristicLab.PluginInfrastructure.Properties.Resources.Details;
    134134      this.detailsButton.Location = new System.Drawing.Point(68, 511);
    135135      this.detailsButton.Name = "detailsButton";
     
    144144      this.listButton.AutoSize = true;
    145145      this.listButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
    146       this.listButton.Image = global::HeuristicLab.Properties.Resources.List;
     146      this.listButton.Image = HeuristicLab.PluginInfrastructure.Properties.Resources.List;
    147147      this.listButton.Location = new System.Drawing.Point(40, 511);
    148148      this.listButton.Name = "listButton";
     
    157157      this.largeIconsButton.AutoSize = true;
    158158      this.largeIconsButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
    159       this.largeIconsButton.Image = global::HeuristicLab.Properties.Resources.LargeIcons;
     159      this.largeIconsButton.Image = HeuristicLab.PluginInfrastructure.Properties.Resources.LargeIcons;
    160160      this.largeIconsButton.Location = new System.Drawing.Point(12, 511);
    161161      this.largeIconsButton.Name = "largeIconsButton";
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/MainForm.cs

    r2497 r2504  
    3333using System.IO;
    3434
    35 namespace HeuristicLab {
     35namespace HeuristicLab.PluginInfrastructure {
    3636  public partial class MainForm : Form {
    3737
     
    4444      InitializeComponent();
    4545
    46       abortRequested = false;
    4746      string pluginPath = Path.GetFullPath(HeuristicLab.PluginInfrastructure.Properties.Settings.Default.PluginDir);
    4847      pluginManager = new PluginManager(pluginPath);
     
    142141    }
    143142
    144     public void ShowErrorMessageBox(Exception ex) {
    145       MessageBox.Show(BuildErrorMessage(ex),
    146                       "Error - " + ex.GetType().Name,
    147                       MessageBoxButtons.OK,
    148                       MessageBoxIcon.Error);
     143    private void ShowErrorMessageBox(Exception ex) {
     144      MessageBoxOptions options = RightToLeft == RightToLeft.Yes ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : MessageBoxOptions.DefaultDesktopOnly;
     145      MessageBox.Show(this,
     146         BuildErrorMessage(ex),
     147         "Error - " + ex.GetType().Name,
     148         MessageBoxButtons.OK,
     149         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, options);
    149150    }
    150     private string BuildErrorMessage(Exception ex) {
     151    private static string BuildErrorMessage(Exception ex) {
    151152      StringBuilder sb = new StringBuilder();
    152153      sb.Append("Sorry, but something went wrong!\n\n" + ex.Message + "\n\n" + ex.StackTrace);
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/SplashScreen.Designer.cs

    r2485 r2504  
    2121
    2222using HeuristicLab.PluginInfrastructure;
    23 namespace HeuristicLab {
     23namespace HeuristicLab.PluginInfrastructure {
    2424  partial class SplashScreen {
    2525    /// <summary>
     
    3939      base.Dispose(disposing);
    4040    }
    41    
     41
    4242
    4343    #region Windows Form Designer generated code
     
    191191      this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    192192                  | System.Windows.Forms.AnchorStyles.Left)));
    193       this.pictureBox.Image = global::HeuristicLab.Properties.Resources.Logo_white;
     193      this.pictureBox.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.Logo_white;
    194194      this.pictureBox.Location = new System.Drawing.Point(-1, -1);
    195195      this.pictureBox.Name = "pictureBox";
  • branches/PluginInfrastructure Refactoring/HeuristicLab.PluginInfrastructure/Starter/SplashScreen.cs

    r2497 r2504  
    2929using HeuristicLab.PluginInfrastructure.Manager;
    3030
    31 namespace HeuristicLab {
    32   public partial class SplashScreen : Form {
     31namespace HeuristicLab.PluginInfrastructure {
     32  internal partial class SplashScreen : Form {
    3333    private const int FADE_INTERVAL = 50;
    3434    private System.Timers.Timer fadeTimer;
    3535    private int initialInterval;
    3636    private object bigLock = new object();
    37     private bool closing = false;
     37    private bool closing;
    3838    private PluginManager manager;
    3939
    40     public SplashScreen() {
     40    internal SplashScreen() {
    4141      InitializeComponent();
    4242    }
    4343
    44     public SplashScreen(PluginManager manager, int initialInterval, string initialText)
     44    internal SplashScreen(PluginManager manager, int initialInterval, string initialText)
    4545      : this() {
    4646      this.initialInterval = initialInterval;
     
    5757
    5858      foreach (object obj in attributes) {
    59         if (obj is AssemblyCopyrightAttribute) {
    60           copyrightLabel.Text = "Copyright " + ((AssemblyCopyrightAttribute)obj).Copyright;
     59        var attr = obj as AssemblyCopyrightAttribute;
     60        if (attr != null) {
     61          copyrightLabel.Text = "Copyright " + attr.Copyright;
    6162        }
    6263      }
    6364
    64       try {
    65         user = HeuristicLab.Properties.Settings.Default.User;
    66         company = HeuristicLab.Properties.Settings.Default.Organization;
     65      user = HeuristicLab.PluginInfrastructure.Properties.Settings.Default.User;
     66      company = HeuristicLab.PluginInfrastructure.Properties.Settings.Default.Organization;
    6767
    68         if ((user == null) || (user.Equals(""))) {
    69           userNameLabel.Text = "-";
    70         } else {
    71           userNameLabel.Text = user;
    72         }
     68      if (string.IsNullOrEmpty(user)) {
     69        userNameLabel.Text = "-";
     70      } else {
     71        userNameLabel.Text = user;
     72      }
    7373
    74         if ((company == null) || (company.Equals(""))) {
    75           companyLabel.Text = "-";
    76         } else {
    77           companyLabel.Text = company;
    78         }
    79       }
    80       catch (Exception) {
    81         userNameLabel.Text = "-";
     74      if (string.IsNullOrEmpty(company)) {
    8275        companyLabel.Text = "-";
     76      } else {
     77        companyLabel.Text = company;
    8378      }
    8479    }
     
    8883    }
    8984
    90     public void managerActionEventHandler(object sender, PluginInfrastructureEventArgs e) {
     85    private void managerActionEventHandler(object sender, PluginInfrastructureEventArgs e) {
    9186      string info = e.Action + ": " + e.Entity;
    9287      //if (e.Action == PluginManagerAction.Initializing) info = "Initializing ...";
Note: See TracChangeset for help on using the changeset viewer.