Exemplo n.º 1
0
            public void StartDrag(IDragInfo dragInfo)
            {
                _projectBrowseControl._controller.AvailableItems_StartDrag(dragInfo.SourceItems, out var data, out var canCopy, out var canMove);

                dragInfo.Effects = GuiHelper.ConvertCopyMoveToDragDropEffect(canCopy, canMove);
                dragInfo.Data    = data;
            }
Exemplo n.º 2
0
            public void StartDrag(IDragInfo dragInfo)
            {
                var result = _parentControl.AvailableItems_StartDrag?.Invoke(dragInfo.SourceItems);

                if (null != result)
                {
                    dragInfo.Effects = GuiHelper.ConvertCopyMoveToDragDropEffect(result.Value.CanCopy, result.Value.CanMove);
                    dragInfo.Data    = result.Value.Data;
                }
            }
Exemplo n.º 3
0
            public void Drop(IDropInfo dropInfo)
            {
                _projectBrowseControl._controller.ListView_Drop(
                    dropInfo.Data is System.Windows.IDataObject ? GuiHelper.ToAltaxo((System.Windows.IDataObject)dropInfo.Data) : dropInfo.Data,
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ControlKey),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ShiftKey),
                    out var isCopy, out var isMove);

                dropInfo.Effects = GuiHelper.ConvertCopyMoveToDragDropEffect(isCopy, isMove); // it is important to get back the resulting effect to dropInfo, because dropInfo informs the drag handler about the resulting effect, which can e.g. delete the items after a move operation
            }
Exemplo n.º 4
0
            public void StartDrag(IDragInfo dragInfo)
            {
                _projectBrowseControl._controller.FolderTree_StartDrag(out var dao, out var canCopy, out var canMove);

                dragInfo.Effects = GuiHelper.ConvertCopyMoveToDragDropEffect(canCopy, canMove);

                if (null != dao)
                {
                    dragInfo.DataObject = GuiHelper.ToWpf(dao);
                }
            }
Exemplo n.º 5
0
            public void StartDrag(IDragInfo dragInfo)
            {
                GuiHelper.SynchronizeSelectionFromGui(_parentControl._guiCurrentItems);
                var result = _parentControl.CurrentItems_StartDrag?.Invoke(dragInfo.SourceItems);

                if (null != result)
                {
                    dragInfo.Effects = GuiHelper.ConvertCopyMoveToDragDropEffect(result.Value.CanCopy, result.Value.CanMove);
                    dragInfo.Data    = result.Value.Data;
                }
            }
Exemplo n.º 6
0
            protected bool CanAcceptData(IDropInfo dropInfo, out System.Windows.DragDropEffects resultingEffect)
            {
                _projectBrowseControl._controller.ListView_DropCanAcceptData(
                    dropInfo.Data is System.Windows.IDataObject ? GuiHelper.ToAltaxo((System.Windows.IDataObject)dropInfo.Data) : dropInfo.Data,
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ControlKey),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ShiftKey),
                    out var canCopy, out var canMove);

                resultingEffect = GuiHelper.ConvertCopyMoveToDragDropEffect(canCopy, canMove);

                return(canCopy | canMove);
            }
Exemplo n.º 7
0
            protected bool CanAcceptData(IDropInfo dropInfo, out System.Windows.DragDropEffects resultingEffect, out Type adornerType)
            {
                _projectBrowseControl._controller.PlotItems_DropCanAcceptData(
                    dropInfo.Data is System.Windows.IDataObject ? GuiHelper.ToAltaxo((System.Windows.IDataObject)dropInfo.Data) : dropInfo.Data,
                    dropInfo.TargetItem as Altaxo.Collections.NGTreeNode,
                    GuiHelper.ToAltaxo(dropInfo.InsertPosition),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ControlKey),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ShiftKey),
                    out var canCopy, out var canMove, out var itemIsSwallowingData);

                resultingEffect = GuiHelper.ConvertCopyMoveToDragDropEffect(canCopy, canMove);
                adornerType     = itemIsSwallowingData ? DropTargetAdorners.Highlight : DropTargetAdorners.Insert;

                return(canCopy | canMove);
            }
Exemplo n.º 8
0
            public void Drop(IDropInfo dropInfo)
            {
                var result = _parentControl.CurrentItems_Drop?.Invoke(
                    dropInfo.Data is System.Windows.IDataObject ? GuiHelper.ToAltaxo((System.Windows.IDataObject)dropInfo.Data) : dropInfo.Data,
                    dropInfo.TargetItem,
                    GuiHelper.ToAltaxo(dropInfo.InsertPosition),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ControlKey),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ShiftKey)
                    );

                if (null != result)
                {
                    dropInfo.Effects = GuiHelper.ConvertCopyMoveToDragDropEffect(result.Value.IsCopy, result.Value.IsMove); // it is important to get back the resulting effect to dropInfo, because dropInfo informs the drag handler about the resulting effect, which can e.g. delete the items after a move operation
                }
            }
Exemplo n.º 9
0
            protected bool CanAcceptData(IDropInfo dropInfo, out DragDropEffects resultingEffect, out Type adornerType)
            {
                var result = _parentControl.CurrentItems_DropCanAcceptData?.Invoke(
                    dropInfo.Data is System.Windows.IDataObject ? GuiHelper.ToAltaxo((System.Windows.IDataObject)dropInfo.Data) : dropInfo.Data,
                    dropInfo.TargetItem,
                    GuiHelper.ToAltaxo(dropInfo.InsertPosition),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ControlKey),
                    dropInfo.KeyStates.HasFlag(DragDropKeyStates.ShiftKey));

                if (null != result)
                {
                    resultingEffect = GuiHelper.ConvertCopyMoveToDragDropEffect(result.Value.CanCopy, result.Value.CanMove);
                    adornerType     = result.Value.ItemIsSwallowingData ? DropTargetAdorners.Highlight : DropTargetAdorners.Insert;

                    return(result.Value.CanCopy | result.Value.CanMove);
                }
                else
                {
                    resultingEffect = DragDropEffects.None;
                    adornerType     = null;
                    return(false);
                }
            }