Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/24/19 13:08:02 (5 years ago)
Author:
dpiringe
Message:

#2924:

  • added CLI Framework HeuristicLab.CommandLineInterface
  • added definition language test project HeuristicLab.DefinitionLanguage
  • added test project HeuristicLab.DynamicAssemblyTestApp, for PluginInfrastructure testing
  • changed project HeuristicLab to .NET Core and used it to create a CLI-Tool with the new CLI Framework
  • added Docker support to HeuristicLab
  • added IRunnerHost.cs ... forgot last commit
  • changed DockerRunnerHost and NativeRunnerHost to HeuristicLab-3.3.exe, was a little test project before
  • added new solution file HeuristicLab 3.3 No Views.sln, where all view projects are unloaded at start
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2924_DotNetCoreMigration/HeuristicLab/3.3/Program.cs

    r16859 r16985  
    2121
    2222using 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;
     23using HeuristicLab.CommandLineInterface;
    3024
    3125namespace HeuristicLab {
    3226  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>
    3827    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);
    6729    }
    68     /*
    69     private static void DiscoverPluginsAndRunOptimizerAsync(PluginManager pluginManager, string[] args) {
    70       // STAThread is necessary for a UI component we are using in the application
    71       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 STA
    82       t.SetApartmentState(ApartmentState.STA);
    83       t.Start();
    84     }*/
    8530  }
    8631}
Note: See TracChangeset for help on using the changeset viewer.