/// <inheritdoc /> public override void OnDragLeave() { _currentDragEffect = DragDropEffect.None; _timeline.DragHandlers.ForEach(x => x.Helper.OnDragLeave()); base.OnDragLeave(); }
public void NotifyDropped(DragDropEffect dropEffect) { if (dropEffect == DragDropEffect.Move) { this.CloseGroup(); } }
/// <inheritdoc /> public override DragDropEffect OnDragEnter(ref Vector2 location, DragData data) { var result = base.OnDragEnter(ref location, data); if (result == DragDropEffect.None) { if (_needSetup) { _needSetup = false; _timeline.SetupDragDrop(); } for (int i = 0; i < _timeline.DragHandlers.Count; i++) { var dragHelper = _timeline.DragHandlers[i].Helper; if (dragHelper.OnDragEnter(data)) { result = dragHelper.Effect; break; } } _currentDragEffect = result; } return(result); }
/// <summary> /// Notifies the handler, that a drag operation has started above the control /// </summary> public void NotifyDragStarted(DragDropEffect effect) { if (effect != DragDropEffect.None) { this.SetUpAdorner(); } }
public void Drop(IEnumerable <IDragSource> nodes, DropPosition mode, DragDropEffect effect, DragDropKeyStates initialKeyStates) { foreach (var node in nodes) { this.Drop(node, mode, effect == DragDropEffect.Copy); } }
public void Drop(IEnumerable<IDragSource> nodes, DropPosition mode, DragDropEffect effect, DragDropKeyStates initialKeyStates) { foreach (var node in nodes) { this.Drop(node, mode, effect == DragDropEffect.Copy); } }
private void HandleDragStart(DragDropEffect effect) { if (this.isDragging == false) { this.OpenPopup(); this.dragTargetHandler.NotifyDragStarted(effect); this.isDragging = true; } }
/// <summary> /// Notifies the handler of an update of the mouse position on the control /// </summary> public void NotifyDragChanged(DragDropEffect effect, DragPosition position) { if (effect == DragDropEffect.None) { this.TearDownAdorner(); } else { this.SetUpAdorner(); } }
/// <summary> /// Drops the data on the target with the given drop effect. <c>additionalDropInfo</c> may contain /// additonal data that can be used during the drop operation, depending on the type of target UI control /// </summary> public void DoDrop(IDataObject data, DragDropEffect effect, AdditionalDropInfo additionalDropInfo) { DragDropItemHandlerBase ItemHandler = this.GetItemHandler(data); if (ItemHandler != null) { ItemHandler.DoDrop(data, effect, additionalDropInfo); } else { throw new InvalidOperationException("drag drop not requested, but doDrop was called"); } }
/// <summary> /// Notifies the handler of an update of the mouse position on the control /// </summary> public void NotifyDragChanged(DragDropEffect effect, DragPosition position) { if (effect == DragDropEffect.None) { this.TearDownAdorner(); } else { int DropIndex = this.CalculateDropIndex(position.GetPosition(this.Element)); Rect DropMarker = this.CalculateDropMarker(DropIndex); this.UpdateAdorner(DropIndex, DropMarker); } }
public bool CanDrop(IDragSource node, DropPosition mode, DragDropEffect effect) { var cvm2 = this; while (cvm2 != null) { if (cvm2 == node) { return(false); } cvm2 = cvm2.Parent; } return(node is NodeViewModel && (mode == DropPosition.Add || this.Parent != null)); }
/// <summary> /// Called when drag enter. /// </summary> /// <param name="data">The data.</param> /// <returns>The result.</returns> public DragDropEffect OnDragEnter(/*ref Vector2 location, */ DragData data) { DragDropEffect effect = DragDropEffect.None; for (var i = 0; i < Count; i++) { var dragHelper = this[i]; if (dragHelper.OnDragEnter(data)) { effect = dragHelper.Effect; } } return(effect); }
/// <inheritdoc /> public override DragDropEffect OnDragEnter(ref Vector2 location, DragData data) { _dragEffect = DragDropEffect.None; var result = base.OnDragEnter(ref location, data); if (result != DragDropEffect.None) { return(result); } if (data is DragDataText textData && DragScripts.IsValidData(textData)) { return(_dragEffect = DragDropEffect.Move); } return(result); }
private DragDropEffects GetDropEffect(DragDropEffects allowedEffects, DragDropKeyStates keyStates, IDataObject data) { DragDropEffects AcceptedEffects = this.targetHandler.GetDropEffects(data); DragDropKeyStates KeyboardStates = keyStates & (DragDropKeyStates.AltKey | DragDropKeyStates.ShiftKey | DragDropKeyStates.ControlKey); DragDropKeyStates MouseStates = keyStates & (DragDropKeyStates.LeftMouseButton | DragDropKeyStates.RightMouseButton | DragDropKeyStates.MiddleMouseButton); if (AcceptedEffects == DragDropEffects.Scroll) { return(DragDropEffects.Scroll); } if (KeyboardStates == DragDropKeyStates.None) { DragDropEffect DefaultEffect = this.targetHandler.GetDefaultEffect(data); if ((allowedEffects & (DragDropEffects)DefaultEffect) != 0) { return((DragDropEffects)DefaultEffect); } } else if ((KeyboardStates & DragDropKeyStates.ControlKey) != 0) { if ((allowedEffects & DragDropEffects.Copy) != 0 && (AcceptedEffects & DragDropEffects.Copy) != 0) { return(DragDropEffects.Copy); } } else if ((KeyboardStates & DragDropKeyStates.ShiftKey) != 0) { if ((allowedEffects & DragDropEffects.Move) != 0 && (AcceptedEffects & DragDropEffects.Move) != 0) { return(DragDropEffects.Move); } } else if ((KeyboardStates & DragDropKeyStates.AltKey) != 0) { if ((allowedEffects & DragDropEffects.Link) != 0 && (AcceptedEffects & DragDropEffects.Link) != 0) { return(DragDropEffects.Link); } } return(DragDropEffects.None); }
/// <inheritdoc /> public override DragDropEffect OnDragDrop(ref Vector2 location, DragData data) { var result = base.OnDragDrop(ref location, data); if (result != DragDropEffect.None) { return(result); } if (_dragEffect != DragDropEffect.None) { result = _dragEffect; _dragEffect = DragDropEffect.None; _editor.ReorderScript(_script, _index); } return(result); }
/// <summary> /// Notifies the handler, that a drag operation has started above the control /// </summary> /// <param name="effect"></param> public void NotifyDragStarted(DragDropEffect effect) { TabPanel TabPanel = this.element.GetVisualDescendantsDepthFirst <TabPanel>().FirstOrDefault(); if (TabPanel != null) { IDragDropUiTargetHandler Handler = DragDrop.GetDragDropUITargetHandler(TabPanel.GetType()); if (Handler != null) { this.panelTargetHandler = Handler.Create(TabPanel, this.adapter, false); } } if (this.panelTargetHandler == null) { this.panelTargetHandler = new DummyUiHandler(); } this.panelTargetHandler.NotifyDragStarted(effect); }
/// <summary> /// Notifies the handler, that a drag operation has started above the control /// </summary> /// <param name="effect"></param> public void NotifyDragStarted(DragDropEffect effect) { ItemsPresenter ItemsPresenter = this.element.GetVisualDescendantsDepthFirst <ItemsPresenter>().FirstOrDefault(); if (ItemsPresenter != null) { Panel ItemsPanel = VisualTreeHelper.GetChild(ItemsPresenter, 0) as Panel; if (ItemsPanel != null) { IDragDropUiTargetHandler Handler = DragDrop.GetDragDropUITargetHandler(ItemsPanel.GetType()); if (Handler != null) { this.panelTargetHandler = Handler.Create(ItemsPanel, this.adapter, false); } } } if (this.panelTargetHandler == null) { this.panelTargetHandler = new DummyUiHandler(); } this.panelTargetHandler.NotifyDragStarted(effect); }
public bool CanDrop(IDragSource node, DropPosition mode, DragDropEffect effect) { return node is NodeViewModel && (mode == DropPosition.Add || this.Parent != null); }
public void NotifyDropped(DragDropEffect dropEffect) { }
public abstract void DoDrop(IDataObject data, DragDropEffect effect, AdditionalDropInfo additionalDropInfo);
override bool CanDrop(TreeNodeController source, DragDropEffect effect) { return(false); }
override bool CanDrop(TreeNodeController source, DragDropEffect effect) { return(!IsReadOnly && !data.IsChildOf(source.data) && effect == DragDropEffect.Move); }
public bool CanDrop(IDragSource node, DropPosition mode, DragDropEffect effect) { return(node is NodeViewModel && (mode == DropPosition.Add || this.Parent != null)); }
private void HandleDragUpdate(DragDropEffect effect, DragPosition position) { this.dragTargetHandler.NotifyDragChanged(effect, position); }
public void NotifyDragChanged(DragDropEffect effect, DragPosition position) { }
public void NotifyDragStarted(DragDropEffect effect) { }
public bool CanDrop(IDragSource node, DropPosition dropPosition, DragDropEffect effect) { return(true); }
public override void DoDrop(IDataObject data, DragDropEffect effect, AdditionalDropInfo additionalDropInfo) { TItemType Data = this.GetData(data); this.doDropAction(Data, effect, additionalDropInfo); }
/// <inheritdoc /> public override void OnDragLeave() { _dragEffect = DragDropEffect.None; base.OnDragLeave(); }
public void Drop(IEnumerable <IDragSource> items, DropPosition dropPosition, DragDropEffect effect, PropertyTools.DragDropKeyStates initialKeyStates) { }
/// <summary> /// Notifies the handler of an update of the mouse position on the control /// </summary> public void NotifyDragChanged(DragDropEffect effect, DragPosition position) { this.panelTargetHandler.NotifyDragChanged(effect, position); }
// ReSharper disable MemberCanBePrivate.Global /// <summary> /// Add handling routines for the given <c>ItemType</c>. Allowed effects are given as concrete values. /// </summary> public DragDropTargetFactory AddTypeHandler <TItemType>(DragDropEffects allowedEffects, DragDropEffect defaultEffect, Action <TItemType, DragDropEffect, AdditionalDropInfo> doDropAction) { return(this.AddTypeHandler(_ => allowedEffects, _ => defaultEffect, doDropAction)); }