Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/10 18:08:26 (15 years ago)
Author:
gkronber
Message:

Worked on GUI for plugin management. #891 (Refactor GUI for plugin management)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/Starter/SplashScreen.cs

    r2790 r2922  
    4646      this.manager = manager;
    4747
    48       manager.Action += managerActionEventHandler;
     48      manager.ApplicationStarted += new EventHandler<PluginInfrastructureEventArgs>(manager_ApplicationStarted);
     49      manager.ApplicationStarting += new EventHandler<PluginInfrastructureEventArgs>(manager_ApplicationStarting);
     50      manager.Initializing += new EventHandler<PluginInfrastructureEventArgs>(manager_Initializing);
     51      manager.Initialized += new EventHandler<PluginInfrastructureEventArgs>(manager_Initialized);
     52      manager.PluginLoaded += new EventHandler<PluginInfrastructureEventArgs>(manager_PluginLoaded);
     53      manager.PluginUnloaded += new EventHandler<PluginInfrastructureEventArgs>(manager_PluginUnloaded);
    4954
    5055      infoLabel.Text = initialText;
     
    6772    }
    6873
     74    void manager_PluginUnloaded(object sender, PluginInfrastructureEventArgs e) {
     75      UpdateMessage("Unloaded " + e.Entity);
     76    }
     77
     78    void manager_PluginLoaded(object sender, PluginInfrastructureEventArgs e) {
     79      UpdateMessage("Loaded " + e.Entity);
     80    }
     81
     82    void manager_Initialized(object sender, PluginInfrastructureEventArgs e) {
     83      UpdateMessage("Initialized");
     84    }
     85
     86    void manager_Initializing(object sender, PluginInfrastructureEventArgs e) {
     87      UpdateMessage("Initializing");
     88    }
     89
     90    void manager_ApplicationStarting(object sender, PluginInfrastructureEventArgs e) {
     91      UpdateMessage("Starting " + e.Entity);
     92    }
     93
     94    void manager_ApplicationStarted(object sender, PluginInfrastructureEventArgs e) {
     95      UpdateMessage("Started " + e.Entity);
     96    }
     97
    6998    private void SetInfoText(string text) {
    7099      if (InvokeRequired) Invoke((Action<string>)SetInfoText, text);
     
    74103    }
    75104
    76     private void managerActionEventHandler(object sender, PluginInfrastructureEventArgs e) {
     105    private void UpdateMessage(string msg) {
    77106      if (InvokeRequired) {
    78         Invoke((EventHandler<PluginInfrastructureEventArgs>)managerActionEventHandler, sender, e);
     107        Invoke((Action<string>)UpdateMessage, msg);
    79108      } else {
    80109        ResetFadeTimer();
    81         string info = e.Action + ": " + e.Entity;
    82         SetInfoText(info);
     110        SetInfoText(msg);
    83111        Application.DoEvents(); // force immediate update of splash screen control
    84112      }
     
    103131        fadeTimer.Stop();
    104132        fadeTimer.Dispose();
    105         manager.Action -= managerActionEventHandler; // remove event before calling close
     133        // remove event before calling close
     134        manager.ApplicationStarted -= new EventHandler<PluginInfrastructureEventArgs>(manager_ApplicationStarted);
     135        manager.ApplicationStarting -= new EventHandler<PluginInfrastructureEventArgs>(manager_ApplicationStarting);
     136        manager.Initializing -= new EventHandler<PluginInfrastructureEventArgs>(manager_Initialized);
     137        manager.Initialized -= new EventHandler<PluginInfrastructureEventArgs>(manager_Initializing);
     138        manager.PluginLoaded -= new EventHandler<PluginInfrastructureEventArgs>(manager_PluginLoaded);
     139        manager.PluginUnloaded -= new EventHandler<PluginInfrastructureEventArgs>(manager_PluginUnloaded);
    106140        Close();
    107141      }
Note: See TracChangeset for help on using the changeset viewer.