- Timestamp:
- 03/03/10 18:08:26 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/Starter/SplashScreen.cs
r2790 r2922 46 46 this.manager = manager; 47 47 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); 49 54 50 55 infoLabel.Text = initialText; … … 67 72 } 68 73 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 69 98 private void SetInfoText(string text) { 70 99 if (InvokeRequired) Invoke((Action<string>)SetInfoText, text); … … 74 103 } 75 104 76 private void managerActionEventHandler(object sender, PluginInfrastructureEventArgs e) {105 private void UpdateMessage(string msg) { 77 106 if (InvokeRequired) { 78 Invoke(( EventHandler<PluginInfrastructureEventArgs>)managerActionEventHandler, sender, e);107 Invoke((Action<string>)UpdateMessage, msg); 79 108 } else { 80 109 ResetFadeTimer(); 81 string info = e.Action + ": " + e.Entity; 82 SetInfoText(info); 110 SetInfoText(msg); 83 111 Application.DoEvents(); // force immediate update of splash screen control 84 112 } … … 103 131 fadeTimer.Stop(); 104 132 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); 106 140 Close(); 107 141 }
Note: See TracChangeset
for help on using the changeset viewer.