Changeset 2481 for branches/PluginInfrastructure Refactoring/HeuristicLab
- Timestamp:
- 11/11/09 18:25:15 (15 years ago)
- Location:
- branches/PluginInfrastructure Refactoring/HeuristicLab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PluginInfrastructure Refactoring/HeuristicLab/HeuristicLab.csproj
r1970 r2481 19 19 </UpgradeBackupLocation> 20 20 <RunPostBuildEvent>Always</RunPostBuildEvent> 21 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 21 22 </PropertyGroup> 22 23 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 72 73 <ItemGroup> 73 74 <Reference Include="System" /> 75 <Reference Include="System.Core"> 76 <RequiredTargetFramework>3.5</RequiredTargetFramework> 77 </Reference> 74 78 <Reference Include="System.Data" /> 75 79 <Reference Include="System.Deployment" /> … … 123 127 </ItemGroup> 124 128 <ItemGroup> 125 <ProjectReference Include="..\HeuristicLab.PluginInfrastructure. GUI\HeuristicLab.PluginInfrastructure.GUI.csproj">126 <Project>{ D3F92C1F-42B4-4EFB-9E73-B64FD3428ADE}</Project>127 <Name>HeuristicLab.PluginInfrastructure. GUI</Name>129 <ProjectReference Include="..\HeuristicLab.PluginInfrastructure.Manager\HeuristicLab.PluginInfrastructure.Manager.csproj"> 130 <Project>{CA8AAD91-E8E2-41AF-96AD-2BA94BC3EF2D}</Project> 131 <Name>HeuristicLab.PluginInfrastructure.Manager</Name> 128 132 </ProjectReference> 129 133 <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj"> -
branches/PluginInfrastructure Refactoring/HeuristicLab/MainForm.cs
r1394 r2481 29 29 using System.Diagnostics; 30 30 using HeuristicLab.PluginInfrastructure; 31 using HeuristicLab.PluginInfrastructure.GUI;32 31 using System.Threading; 32 using HeuristicLab.PluginInfrastructure.Manager; 33 33 34 34 namespace HeuristicLab { … … 38 38 private bool abortRequested; 39 39 40 public MainForm() { 40 public MainForm() 41 : base() { 42 InitializeComponent(); 43 41 44 abortRequested = false; 42 SplashScreen splashScreen = new SplashScreen(1000, "Loading HeuristicLab..."); 45 PluginManager pluginManager = new PluginManager(HeuristicLab.PluginInfrastructure.Properties.Settings.Default.PluginDir); 46 SplashScreen splashScreen = new SplashScreen(pluginManager, 1000, "Loading HeuristicLab..."); 43 47 splashScreen.Owner = this; 44 48 splashScreen.Show(); … … 47 51 this.Enabled = false; 48 52 49 PluginManager.Manager.Action += new PluginManagerActionEventHandler(splashScreen.Manager_Action); 50 PluginManager.Manager.Initialize(); 53 pluginManager.Initialize(); 51 54 52 InitializeComponent();53 54 RefreshApplicationsList();55 56 this.Enabled = true;57 this.Visible = true;58 }59 60 private void RefreshApplicationsList() {61 55 applicationsListView.Items.Clear(); 62 56 … … 69 63 applicationsListView.Items.Add(pluginManagerListViewItem); 70 64 71 foreach (Application Info info in PluginManager.Manager.InstalledApplications) {65 foreach (ApplicationDescription info in pluginManager.Applications) { 72 66 ListViewItem item = new ListViewItem(info.Name, 0); 73 67 item.Tag = info; … … 78 72 applicationsListView.Items.Add(item); 79 73 } 74 75 76 this.Enabled = true; 77 this.Visible = true; 80 78 } 81 79 … … 89 87 this.Visible = false; 90 88 form.ShowDialog(this); 91 RefreshApplicationsList();89 // RefreshApplicationsList(); 92 90 this.Visible = true; 93 91 } … … 96 94 } 97 95 } else { 98 Application Info app = (ApplicationInfo)applicationsListView.SelectedItems[0].Tag;96 ApplicationDescription app = (ApplicationDescription)applicationsListView.SelectedItems[0].Tag; 99 97 SplashScreen splashScreen = new SplashScreen(2000, "Loading " + app.Name); 100 98 splashScreen.Owner = this; -
branches/PluginInfrastructure Refactoring/HeuristicLab/SplashScreen.cs
r2442 r2481 27 27 using System.Reflection; 28 28 using HeuristicLab.PluginInfrastructure; 29 using HeuristicLab.PluginInfrastructure.Manager; 29 30 30 31 namespace HeuristicLab { … … 35 36 private object bigLock = new object(); 36 37 private bool closing = false; 38 private PluginManager manager; 37 39 38 40 public SplashScreen() { 39 41 InitializeComponent(); 42 } 40 43 44 public SplashScreen(PluginManager manager, int initialInterval, string initialText) 45 : this() { 46 this.initialInterval = initialInterval; 47 infoLabel.Text = initialText; 48 this.manager = manager; 49 manager.Action += new PluginManagerActionEventHandler(Manager_Action); 41 50 Assembly assembly = this.GetType().Assembly; 42 51 object[] attributes = assembly.GetCustomAttributes(false); … … 47 56 infoLabel.Text = ""; 48 57 49 foreach (object obj in attributes) {50 if (obj is AssemblyCopyrightAttribute) {58 foreach (object obj in attributes) { 59 if (obj is AssemblyCopyrightAttribute) { 51 60 copyrightLabel.Text = "Copyright " + ((AssemblyCopyrightAttribute)obj).Copyright; 52 61 } … … 57 66 company = HeuristicLab.Properties.Settings.Default.Organization; 58 67 59 if ((user == null) || (user.Equals(""))) {68 if ((user == null) || (user.Equals(""))) { 60 69 userNameLabel.Text = "-"; 61 70 } else { … … 63 72 } 64 73 65 if ((company == null) || (company.Equals(""))) {74 if ((company == null) || (company.Equals(""))) { 66 75 companyLabel.Text = "-"; 67 76 } else { 68 77 companyLabel.Text = company; 69 78 } 70 } catch(Exception) { 79 } 80 catch (Exception) { 71 81 userNameLabel.Text = "-"; 72 82 companyLabel.Text = "-"; 73 83 } 74 }75 76 public SplashScreen(int initialInterval, string initialText)77 : this() {78 this.initialInterval = initialInterval;79 infoLabel.Text = initialText;80 84 } 81 85 … … 86 90 public void Manager_Action(object sender, PluginManagerActionEventArgs e) { 87 91 string info; 88 if(e.Action == PluginManagerAction.Initializing) info = "Initializing ..."; 89 else if(e.Action == PluginManagerAction.InitializingPlugin) info = "Initializing Plugin " + e.Id + " ..."; 90 else if(e.Action == PluginManagerAction.InitializedPlugin) info = "Initializing Plugin " + e.Id + " ... Initialized"; 91 else if(e.Action == PluginManagerAction.Initialized) { 92 if (e.Action == PluginManagerAction.Initializing) info = "Initializing ..."; 93 else if (e.Action == PluginManagerAction.PluginLoaded) info = "Loaded plugin " + e.Id + " ..."; 94 else if (e.Action == PluginManagerAction.Initialized) { 92 95 info = "Initialization Completed"; 93 96 fadeTimer = new System.Timers.Timer(); … … 98 101 fadeTimer.Start(); 99 102 } else { 100 if (e.Id != null) info = e.Action.ToString() + " (" + e.Id + ")";103 if (e.Id != null) info = e.Action.ToString() + " (" + e.Id + ")"; 101 104 else info = e.Action.ToString(); 102 105 } … … 107 110 private void fadeTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { 108 111 fadeTimer.Stop(); 109 if (InvokeRequired) {112 if (InvokeRequired) { 110 113 Invoke((MethodInvoker)UpdateOpacity); 111 114 } else { … … 140 143 closing = true; 141 144 if (fadeTimer != null) fadeTimer.Stop(); 142 PluginManager.Manager.Action -= new PluginManagerActionEventHandler(this.Manager_Action); // remove event before calling close145 manager.Action -= new PluginManagerActionEventHandler(this.Manager_Action); // remove event before calling close 143 146 Application.DoEvents(); // work up all existing events 144 147 Close(); // close
Note: See TracChangeset
for help on using the changeset viewer.