コード例 #1
0
        public void MouseMove(object sender, MouseEventArgs e)
        {
            if (!CanStartDrag)
            {
                return;
            }

            // Abort if there is no Pokemon in the given slot.
            PictureBox pb = (PictureBox)sender;

            if (pb.Image == null)
            {
                return;
            }
            var view = WinFormsUtil.FindFirstControlOfType <ISlotViewer <PictureBox> >(pb);
            var src  = view.GetSlotData(pb);

            if (!src.Editable || SAV.IsSlotLocked(src.Box, src.Slot))
            {
                return;
            }
            bool encrypt = Control.ModifierKeys == Keys.Control;

            HandleMovePKM(pb, encrypt);
        }
コード例 #2
0
        public void DragDrop(object sender, DragEventArgs e)
        {
            PictureBox pb   = (PictureBox)sender;
            var        view = WinFormsUtil.FindFirstControlOfType <ISlotViewer <PictureBox> >(pb);
            var        src  = view.GetSlotData(pb);

            if (!src.Editable || SAV.IsSlotLocked(src.Box, src.Slot))
            {
                SystemSounds.Asterisk.Play();
                e.Effect = DragDropEffects.Copy;
                DragInfo.Reset();
                return;
            }

            bool overwrite = Control.ModifierKeys == Keys.Alt;
            bool clone     = Control.ModifierKeys == Keys.Control;

            DragInfo.Destination = src;
            HandleDropPKM(sender, e, overwrite, clone);
        }