Exemplo n.º 1
0
        public DialogPictureInfo(PictureBoxCustom p)
        {
            InitializeComponent();

            PictureBox = p;
            this.dateTimePicker.MaxDate = DateTime.Today;
        }
Exemplo n.º 2
0
        public DialogPictureInfo(PictureBoxCustom p)
        {
            InitializeComponent();

            PictureBox = p;
            this.dateTimePicker.MaxDate = DateTime.Today;
        }
Exemplo n.º 3
0
        protected override void OnDragDrop(DragEventArgs e)
        {
            base.OnDragDrop(e);

            Point        cp          = this.PointToClient(new Point(e.X, e.Y));
            ListViewItem destination = this.GetItemAt(cp.X, cp.Y);

            if (base.SelectedItems.Count == 0)
            {
                return;
            }

            if (e.Data.GetDataPresent(typeof(ListViewItem)))
            {
                ListViewItem source = (ListViewItem)e.Data.GetData(typeof(ListViewItem));

                if (destination == null)
                {
                    return;
                }

                int dropIndex = destination.Index;

                ListViewItem insertItem = (ListViewItem)source.Clone();

                this.Items.Remove(source);
                this.Items.Insert(dropIndex, source);

                UpdatePositionAlbum();

                this.OnMessageSortAlbum();
            }
            else if (e.Data.GetDataPresent(typeof(PictureBoxCustom)))
            {
                PictureBoxCustom pbc = (PictureBoxCustom)e.Data.GetData(typeof(PictureBoxCustom));

                this.OnMessageMovePicture((Album)destination.Tag, pbc);
            }
        }
Exemplo n.º 4
0
        protected override void OnDragOver(DragEventArgs e)
        {
            Point        cp        = base.PointToClient(new Point(e.X, e.Y));
            ListViewItem hoverItem = base.GetItemAt(cp.X, cp.Y);

            if (hoverItem == null)
            {
                e.Effect = DragDropEffects.None;
                return;
            }

            if (e.Data.GetDataPresent(typeof(ListViewItem)))
            {
                foreach (ListViewItem moveItem in base.SelectedItems)
                {
                    if (moveItem.Index == hoverItem.Index)
                    {
                        e.Effect = DragDropEffects.None;
                        hoverItem.EnsureVisible();
                        return;
                    }
                }
            }
            else if (e.Data.GetDataPresent(typeof(PictureBoxCustom)))
            {
                if (hoverItem.Index == indexAlbumFirstSelected)
                {
                    e.Effect = DragDropEffects.None;
                    hoverItem.EnsureVisible();
                    return;
                }
            }

            base.OnDragOver(e);

            if (e.Data.GetDataPresent(typeof(ListViewItem)))
            {
                ListViewItem source = (ListViewItem)e.Data.GetData(typeof(ListViewItem));

                if (source != null)
                {
                    e.Effect = DragDropEffects.Move;
                    hoverItem.EnsureVisible();
                }
                else
                {
                    e.Effect = DragDropEffects.None;
                }
            }
            else if (e.Data.GetDataPresent(typeof(PictureBoxCustom)))
            {
                PictureBoxCustom source = (PictureBoxCustom)e.Data.GetData(typeof(PictureBoxCustom));

                if (source != null)
                {
                    e.Effect = DragDropEffects.Move;
                    hoverItem.EnsureVisible();

                    //this.Items[hoverItem.Index].Selected = true;
                }
                else
                {
                    e.Effect = DragDropEffects.None;
                }
            }
        }
Exemplo n.º 5
0
 public DialogMoveOrCopy(Album album, PictureBoxCustom pictureBox)
 {
     InitializeComponent();
     this.album = album;
     this.pictureBox = pictureBox;
 }
Exemplo n.º 6
0
 public DialogMoveOrCopy(Album album, PictureBoxCustom pictureBox)
 {
     InitializeComponent();
     this.album      = album;
     this.pictureBox = pictureBox;
 }