Changeset 12610
- Timestamp:
- 07/06/15 15:52:06 (9 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12181-12182
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Scripting.Views/3.3/VariableStoreView.cs
r12275 r12610 32 32 using HeuristicLab.MainForm.WindowsForms; 33 33 using HeuristicLab.Persistence.Core; 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 34 35 using HeuristicLab.Persistence.Default.Xml; 35 36 using HeuristicLab.PluginInfrastructure; … … 236 237 if (!(item.Value is IDeepCloneable)) return; 237 238 var data = new DataObject(HeuristicLab.Common.Constants.DragDropDataFormat, item); 238 DoDragDrop(data, DragDropEffects.Copy );239 DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link); 239 240 } 240 241 protected virtual void variableListView_DragEnter(object sender, DragEventArgs e) { … … 252 253 e.Effect = DragDropEffects.None; 253 254 if (validDragOperation) { 254 if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) 255 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; 256 258 } 257 259 } 258 260 protected virtual void variableListView_DragDrop(object sender, DragEventArgs e) { 259 if (e.Effect != DragDropEffects.Copy) return; 261 if (e.Effect == DragDropEffects.None) return; 262 260 263 object item = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 261 264 … … 278 281 if (cloneable == null) return; 279 282 280 var clonedItem = cloneable.Clone(); 281 Content.Add(variableName, clonedItem); 283 Content.Add(variableName, e.Effect.HasFlag(DragDropEffects.Copy) ? cloneable.Clone() : cloneable); 282 284 283 285 var listViewItem = variableListView.FindItemWithText(variableName); … … 474 476 if (variable.Value != null) { 475 477 type = variable.Value.GetType(); 476 if (serializableLookup.TryGetValue(type, out serializable)) 477 return serializable;478 if (serializableLookup.TryGetValue(type, out serializable)) return serializable; 479 if (StorableClassAttribute.IsStorableClass(type)) return serializableLookup[type] = true; 478 480 } 479 481
Note: See TracChangeset
for help on using the changeset viewer.