Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/11 11:03:48 (13 years ago)
Author:
cneumuel
Message:

#1215

  • fixed import of existing algorithm
  • moved operators in subfolders
  • extended tests for SymbolicExpressionGrammar
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/MetaOptimizationProblemView.cs

    r5654 r6017  
    22using System.Linq;
    33using System.Windows.Forms;
     4using HeuristicLab.Common;
    45using HeuristicLab.Core;
    56using HeuristicLab.MainForm;
     
    8990    private void parameterCollectionView_DragEnterOver(object sender, System.Windows.Forms.DragEventArgs e) {
    9091      e.Effect = DragDropEffects.None;
    91       Type type = e.Data.GetData("Type") as Type;
    92       if ((type != null) && (Content.AlgorithmType.ValidTypes.Contains(type))) {
    93         IAlgorithm algorithm = e.Data.GetData("Value") as IAlgorithm;
     92      var type = e.Data.GetData(Constants.DragDropDataFormat).GetType();
     93      if (!ReadOnly && (Content.AlgorithmType.ValidTypes.Contains(type))) {
     94        IAlgorithm algorithm = e.Data.GetData(Constants.DragDropDataFormat) as IAlgorithm;
    9495        if (algorithm != null && algorithm.Problem == null || Content.ProblemType.ValidTypes.Contains(algorithm.Problem.GetType())) {
    9596          e.Effect = DragDropEffects.Copy;
     
    99100    private void parameterCollectionView_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {
    100101      if (e.Effect != DragDropEffects.None) {
    101         IAlgorithm algorithm = e.Data.GetData("Value") as IAlgorithm;
     102        IAlgorithm algorithm = e.Data.GetData(Constants.DragDropDataFormat) as IAlgorithm;
    102103        Content.ImportAlgorithm(algorithm);
    103104      }
Note: See TracChangeset for help on using the changeset viewer.