Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/11 12:00:36 (13 years ago)
Author:
mkommend
Message:

#1479: Integrated trunk changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs

    r6675 r6784  
    2525using System.Linq;
    2626using System.Windows.Forms;
     27using HeuristicLab.Core;
    2728using HeuristicLab.Core.Views;
    2829using HeuristicLab.MainForm;
     
    139140    protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
    140141      validDragOperation = false;
    141       if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is DataAnalysisProblemData)) {
    142         validDragOperation = true;
     142      if (ReadOnly) return;
     143
     144      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
     145      if (dropData is DataAnalysisProblemData) validDragOperation = true;
     146      else if (dropData is IValueParameter) {
     147        var param = (IValueParameter)dropData;
     148        if (param.Value is DataAnalysisProblemData) validDragOperation = true;
    143149      }
    144150    }
     
    146152    protected override void itemsListView_DragDrop(object sender, DragEventArgs e) {
    147153      if (e.Effect != DragDropEffects.None) {
    148         if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is DataAnalysisProblemData) {
    149           DataAnalysisProblemData problemData = (DataAnalysisProblemData)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
     154        var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
     155        if (dropData is DataAnalysisProblemData) {
     156          DataAnalysisProblemData problemData = (DataAnalysisProblemData)dropData;
    150157          Content.ProblemData = (DataAnalysisProblemData)problemData.Clone();
     158        } else if (dropData is IValueParameter) {
     159          var param = (IValueParameter)dropData;
     160          DataAnalysisProblemData problemData = param.Value as DataAnalysisProblemData;
     161          if (problemData != null)
     162            Content.ProblemData = (DataAnalysisProblemData)problemData.Clone();
    151163        }
    152164      }
Note: See TracChangeset for help on using the changeset viewer.