Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/11 09:00:45 (12 years ago)
Author:
swagner
Message:

Corrected cloning of multiple dropped items (#1564)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

    • Property svn:ignore
      •  

        old new  
        1212*.psess
        1313*.vsp
         14*.docstates
  • trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs

    r5839 r6527  
    2727using System.Threading;
    2828using System.Windows.Forms;
     29using HeuristicLab.Common;
    2930using HeuristicLab.MainForm;
    3031using HeuristicLab.Persistence.Default.Xml;
     
    321322          } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) {
    322323            IEnumerable<T> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<T>();
     324            if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     325              Cloner cloner = new Cloner();
     326              items = items.Select(x => cloner.Clone(x));
     327            }
    323328            foreach (T item in items)
    324               AddItem(e.Effect.HasFlag(DragDropEffects.Copy) ? (T)item.Clone() : item);
     329              AddItem(item);
    325330          }
    326331        }
Note: See TracChangeset for help on using the changeset viewer.