Ignore:
Timestamp:
05/18/12 14:08:11 (8 years ago)
Author:
abeham
Message:

#1851:

  • Moved common methods from problem instance management into a ProblemInstanceManager
  • Made experiment creation asynchronous by using a BackgroundWorker
  • Added a progress bar to display the progress as well as the instance that is currently processed
  • Added "select all" and "select none" options which are updated to the state of the listview
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceConsumerView.cs

    r7805 r7846  
    2828using HeuristicLab.MainForm;
    2929using HeuristicLab.MainForm.WindowsForms;
    30 using HeuristicLab.PluginInfrastructure;
    3130
    3231namespace HeuristicLab.Problems.Instances.Views {
     
    6362      } else {
    6463        problemInstanceProviderComboBox.DisplayMember = "Name";
    65         ProblemInstanceProviders = GetProblemInstanceProviders();
     64        ProblemInstanceProviders = ProblemInstanceManager.GetProviders(Content);
    6665        problemInstanceProviderComboBox.DataSource = ProblemInstanceProviders.OrderBy(x => x.Name).ToList();
    6766      }
    6867      SetEnabledStateOfControls();
    69     }
    70 
    71     private IEnumerable<IProblemInstanceProvider> GetProblemInstanceProviders() {
    72       var consumerTypes = Content.GetType().GetInterfaces()
    73         .Where(x => x.IsGenericType
    74           && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));
    75 
    76       if (consumerTypes.Any()) {
    77         var instanceTypes = consumerTypes
    78           .Select(x => x.GetGenericArguments().First())
    79           .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));
    80 
    81         foreach (var type in instanceTypes) {
    82           foreach (var provider in ApplicationManager.Manager.GetInstances(type))
    83             yield return (IProblemInstanceProvider)provider;
    84         }
    85       }
    8668    }
    8769
Note: See TracChangeset for help on using the changeset viewer.