Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/17/12 21:46:00 (12 years ago)
Author:
jkarder
Message:

#1926:

  • added OpenArgument
  • refactored argument handling infrastructure
Location:
trunk/sources/HeuristicLab.Optimizer/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs

    r8587 r8818  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using System.Windows.Forms;
     
    5960
    6061      if (openFileDialog.ShowDialog() == DialogResult.OK) {
    61         foreach (string filename in openFileDialog.FileNames) {
    62           ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor();
    63           ContentManager.LoadAsync(filename, LoadingCompleted);
    64         }
     62        OpenFiles(openFileDialog.FileNames);
    6563      }
    6664    }
     65
     66    public static void OpenFiles(IEnumerable<string> fileNames) {
     67      foreach (string filename in fileNames) {
     68        ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).SetAppStartingCursor();
     69        ContentManager.LoadAsync(filename, LoadingCompleted);
     70      }
     71    }
     72
    6773    private static void LoadingCompleted(IStorableContent content, Exception error) {
    6874      try {
  • trunk/sources/HeuristicLab.Optimizer/3.3/Plugin.cs.frame

    r8246 r8818  
    2020#endregion
    2121
     22using System.Linq;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Clients.Access;
     
    4849  [Application("Optimizer", "HeuristicLab Optimizer 3.3.7.$WCREV$")]
    4950  internal class HeuristicLabOptimizerApplication : ApplicationBase {
    50     public override void Run() {
    51      HeuristicLab.MainForm.WindowsForms.MainForm mainForm = null;
     51    public override void Run(ICommandLineArgument[] args) {
     52      HeuristicLab.MainForm.WindowsForms.MainForm mainForm = null;
    5253
    5354      if (Settings.Default.MainFormType == OptimizerMainFormTypes.DockingMainForm) {
     
    6465
    6566        mainForm.ShowContentInViewHost = true;
     67        mainForm.Arguments = args;
     68        var filesToOpen = mainForm.Arguments.OfType<OpenArgument>().Select(x => x.Value);
     69        mainForm.Load += (sender, eventArgs) => FileManager.OpenFiles(filesToOpen);
    6670        Application.Run(mainForm);
    6771      } else {
Note: See TracChangeset for help on using the changeset viewer.