- Timestamp:
- 05/24/19 13:08:02 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2924_DotNetCoreMigration/HeuristicLab/3.3/Program.cs
r16859 r16985 21 21 22 22 using System; 23 using System.IO; 24 using System.Linq; 25 using System.Threading; 26 using System.Threading.Tasks; 27 using System.Windows.Forms; 28 using HeuristicLab.PluginInfrastructure; 29 using HeuristicLab.PluginInfrastructure.UI; 23 using HeuristicLab.CommandLineInterface; 30 24 31 25 namespace HeuristicLab { 32 26 static class Program { 33 [STAThread]34 /// <summary>35 /// Main entry point of the plugin infrastructure. Loads the starter form.36 /// </summary>37 /// <param name="args">Command line arguments</param>38 27 static void Main(string[] args) { 39 /*if ((!FrameworkVersionErrorDialog.NET4_5Installed && !FrameworkVersionErrorDialog.MonoInstalled) 40 || (FrameworkVersionErrorDialog.MonoInstalled && !FrameworkVersionErrorDialog.MonoCorrectVersionInstalled)) { 41 Application.EnableVisualStyles(); 42 Application.SetCompatibleTextRenderingDefault(false); 43 Application.Run(new FrameworkVersionErrorDialog()); 44 } else { 45 try { 46 Application.EnableVisualStyles(); 47 Application.SetCompatibleTextRenderingDefault(false); 48 49 string pluginPath = Path.GetFullPath(Application.StartupPath); 50 51 var pluginManager = new PluginManager(pluginPath); 52 53 var splashScreen = new SplashScreen("Loading plugins...", 3000); 54 pluginManager.Initializing += (sender, eventArgs) => splashScreen.UpdateMessage("Loading plugins..."); 55 pluginManager.PluginLoaded += (sender, eventArgs) => splashScreen.UpdateMessage("Loaded " + eventArgs.Entity.ToString()); 56 pluginManager.ApplicationStarting += (sender, eventArgs) => splashScreen.UpdateMessage("Starting " + eventArgs.Entity.ToString()); 57 pluginManager.ApplicationStarted += (sender, eventArgs) => splashScreen.UpdateMessage("Started " + eventArgs.Entity.ToString()); 58 59 60 DiscoverPluginsAndRunOptimizerAsync(pluginManager, args); 61 62 Application.Run(splashScreen); 63 } catch (Exception ex) { 64 MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); 65 } 66 }*/ 28 CLIApplication.Parse<ApplicationCommand>(args); 67 29 } 68 /*69 private static void DiscoverPluginsAndRunOptimizerAsync(PluginManager pluginManager, string[] args) {70 // STAThread is necessary for a UI component we are using in the application71 var t = new Thread(() => {72 try {73 pluginManager.DiscoverAndCheckPlugins();74 var optimizerApp = pluginManager.Applications.FirstOrDefault(app => app.Name == "Optimizer");75 pluginManager.Run(optimizerApp, CommandLineArgumentHandling.GetArguments(args));76 } catch (Exception ex) {77 MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);78 }79 });80 81 // cannot use a task because we need to set STA82 t.SetApartmentState(ApartmentState.STA);83 t.Start();84 }*/85 30 } 86 31 }
Note: See TracChangeset
for help on using the changeset viewer.