Ejemplo n.º 1
0
        private void cmdMoveUp_Click(object sender, EventArgs e)
        {
            SABnzbdItemsCollection MoveCol = new SABnzbdItemsCollection();
            foreach (int SelIndex in DownloadList.SelectedIndices)
                MoveCol.Add(Global.SABnzbd.Status.QueuedItems[SelIndex]);

            foreach (SABnzbdItem qi in MoveCol)
            {
                Global.SABnzbd.MoveItem(qi, qi.Index - 1);
                DownloadList.SelectedIndices.Remove(qi.Index);
                DownloadList.SelectedIndices.Add(qi.Index - 1);
            }
        }
Ejemplo n.º 2
0
        void cmdMoveTop_Click(object sender, EventArgs e)
        {
            SABnzbdItemsCollection MoveCol = new SABnzbdItemsCollection();
            foreach (int SelIndex in DownloadList.SelectedIndices)
                MoveCol.Add(Global.SABnzbd.Status.QueuedItems[SelIndex]);

            for (int i = 0; i < MoveCol.Count; i++)
            {
                SABnzbdItem qi = MoveCol[i];
                Global.SABnzbd.MoveItem(qi, i);
                DownloadList.SelectedIndices.Remove(qi.Index);
                DownloadList.SelectedIndices.Add(i);
            }

            UpdateControls();
        }
Ejemplo n.º 3
0
        void cmdMoveBottom_Click(object sender, EventArgs e)
        {
            SABnzbdItemsCollection MoveCol = new SABnzbdItemsCollection();
            foreach (int SelIndex in DownloadList.SelectedIndices)
                MoveCol.Add(Global.SABnzbd.Status.QueuedItems[SelIndex]);

            for (int i = MoveCol.Count - 1; i >= 0; i--)
            {
                SABnzbdItem qi = MoveCol[i];
                int NewIndex = DownloadList.VirtualListSize - (MoveCol.Count - i);
                Global.SABnzbd.MoveItem(qi, NewIndex);
                DownloadList.SelectedIndices.Remove(qi.Index);
                DownloadList.SelectedIndices.Add(NewIndex);
            }

            UpdateControls();
        }
Ejemplo n.º 4
0
        private void cmdMoveDown_Click(object sender, EventArgs e)
        {
            SABnzbdItemsCollection MoveCol = new SABnzbdItemsCollection();
            foreach (int SelIndex in DownloadList.SelectedIndices)
                MoveCol.Add(Global.SABnzbd.Status.QueuedItems[SelIndex]);

            for(int i = MoveCol.Count - 1; i >= 0; i--)
            {
                SABnzbdItem qi = MoveCol[i];
                Global.SABnzbd.MoveItem(qi, qi.Index + 1);
                DownloadList.SelectedIndices.Remove(qi.Index);
                DownloadList.SelectedIndices.Add(qi.Index + 1);
            }
        }
Ejemplo n.º 5
0
        private void cmdDelete_Click(object sender, EventArgs e)
        {
            SABnzbdItemsCollection DeleteCol = new SABnzbdItemsCollection();
            foreach (int SelIndex in DownloadList.SelectedIndices)
                DeleteCol.Add(Global.SABnzbd.Status.QueuedItems[SelIndex]);

            if (MessageBox.Show("Remove all selected items from the queue?", "NzbSearcher", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                for (int i = DeleteCol.Count - 1; i >= 0; i--)
                {
                    SABnzbdItem qi = DeleteCol[i];
                    Global.SABnzbd.RemoveFromQueue(qi);
                    DownloadList.SelectedIndices.Remove(qi.Index);
                }
            }
        }