Changeset 12182
- Timestamp:
- 03/10/15 15:43:15 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs
r12181 r12182 237 237 if (!(item.Value is IDeepCloneable)) return; 238 238 var data = new DataObject(HeuristicLab.Common.Constants.DragDropDataFormat, item); 239 DoDragDrop(data, DragDropEffects.Copy );239 DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link); 240 240 } 241 241 protected virtual void variableListView_DragEnter(object sender, DragEventArgs e) { … … 253 253 e.Effect = DragDropEffects.None; 254 254 if (validDragOperation) { 255 if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) 256 e.Effect = DragDropEffects.Copy; 255 if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key 256 else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 257 else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link; 257 258 } 258 259 } 259 260 protected virtual void variableListView_DragDrop(object sender, DragEventArgs e) { 260 if (e.Effect != DragDropEffects.Copy) return; 261 if (e.Effect == DragDropEffects.None) return; 262 261 263 object item = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 262 264 … … 279 281 if (cloneable == null) return; 280 282 281 var clonedItem = cloneable.Clone(); 282 Content.Add(variableName, clonedItem); 283 Content.Add(variableName, e.Effect.HasFlag(DragDropEffects.Copy) ? cloneable.Clone() : cloneable); 283 284 284 285 var listViewItem = variableListView.FindItemWithText(variableName);
Note: See TracChangeset
for help on using the changeset viewer.