Exemplo n.º 1
0
 public RawDragEvent(IDragDropDevice inputDevice, RawDragEventType type,
                     IInputRoot root, Point location, IDataObject data, DragDropEffects effects, RawInputModifiers modifiers)
     : base(inputDevice, 0, root)
 {
     Type      = type;
     Location  = location;
     Data      = data;
     Effects   = effects;
     Modifiers = (InputModifiers)modifiers;
 }
Exemplo n.º 2
0
 public RawDragEvent(IDragDropDevice inputDevice, RawDragEventType type,
                     IInputElement inputRoot, Point location, IDataObject data, DragDropEffects effects)
     : base(inputDevice, 0)
 {
     Type      = type;
     InputRoot = inputRoot;
     Location  = location;
     Data      = data;
     Effects   = effects;
 }
Exemplo n.º 3
0
        public RawDragEvent(IDragDropDevice inputDevice, RawDragEventType type,
                            IInputRoot root, Point location, IDataObject data, DragDropEffects effects, RawInputModifiers modifiers)
            : base(inputDevice, 0, root)
        {
            Type         = type;
            Location     = location;
            Data         = data;
            Effects      = effects;
            KeyModifiers = modifiers.ToKeyModifiers();
#pragma warning disable CS0618 // Type or member is obsolete
            Modifiers = (InputModifiers)modifiers;
#pragma warning restore CS0618 // Type or member is obsolete
        }
Exemplo n.º 4
0
        private DragDropEffects RaiseEventAndUpdateCursor(RawDragEventType type, IInputRoot root, Point pt, RawInputModifiers modifiers)
        {
            _lastPosition = pt;

            RawDragEvent rawEvent = new RawDragEvent(_dragDrop, type, root, pt, _draggedData, _allowedEffects, modifiers);
            var          tl       = root.GetSelfAndVisualAncestors().OfType <TopLevel>().FirstOrDefault();

            tl.PlatformImpl?.Input(rawEvent);

            var effect = GetPreferredEffect(rawEvent.Effects & _allowedEffects, modifiers);

            UpdateCursor(root, effect);
            return(effect);
        }
Exemplo n.º 5
0
            private NSDragOperation SendRawDragEvent(NSDraggingInfo sender, RawDragEventType type)
            {
                Action <RawInputEventArgs> input      = _tl.Input;
                IDragDropDevice            dragDevice = _tl._dragDevice;
                IInputRoot root = _tl?.InputRoot;

                if (root == null || dragDevice == null || input == null)
                {
                    return(NSDragOperation.None);
                }

                var          dragOp = DraggingInfo.ConvertDragOperation(sender.DraggingSourceOperationMask);
                DraggingInfo info   = new DraggingInfo(sender);
                var          pt     = TranslateLocalPoint(info.Location);
                var          args   = new RawDragEvent(dragDevice, type, root, pt, info, dragOp);

                input(args);
                return(DraggingInfo.ConvertDragOperation(args.Effects));
            }