Exemple #1
0
        ///<summary>Move selected items from us to another BaseBox.</summary>
        protected virtual void ListView1DoubleClick(object sender, EventArgs e)
        {
            if (GetMoveTarget == null)
            {
                return;
            }

            BaseBox target = GetMoveTarget();

            if (target == null)
            {
                return;
            }

            foreach (ListViewItem item in listView1.SelectedItems)
            {
                item.Remove();
                target.Items.Add(item);
            }

            target.ListView.SelectedItems.Clear();
            target.ListView.Sort();

            Recalculate();
            target.Recalculate();

            RankTeams?.Invoke();
        }
Exemple #2
0
        ///<summary>Move selected items from another BaseBox to us.</summary>
        protected virtual void ListView1DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(typeof(ListView.SelectedListViewItemCollection).ToString(), false))
            {
                BaseBox target = null;

                ListView.SelectedListViewItemCollection items = (ListView.SelectedListViewItemCollection)e.Data.GetData(typeof(ListView.SelectedListViewItemCollection));
                foreach (ListViewItem item in items)
                {
                    target = item.ListView.GetContainerControl() as BaseBox;
                    item.Remove();
                    listView1.Items.Add(item);
                }
                listView1.SelectedItems.Clear();
                listView1.Sort();

                Recalculate();
                target.Recalculate();

                RankTeams?.Invoke();
            }
        }