Esempio n. 1
0
        // Double Click - Open Download Properties for the selected download
        private void DownloadList_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            var selectedItem = (dynamic)DownloadList.SelectedItem;

            if (selectedItem != null)
            {
                Mackerel.OpenDownloadProperties(selectedItem.DownloadID);
            }
        }
Esempio n. 2
0
        // Right Click - Open Download Properties for the selected download
        private void OpenDownloadProperties_Click(object sender, RoutedEventArgs e)
        {
            var selectedItem = (dynamic)DownloadList.SelectedItem;

            if (selectedItem != null)
            {
                Mackerel.OpenDownloadProperties(selectedItem.DownloadID);
            }
        }
Esempio n. 3
0
        void DeleteCompletedDownloads_Click(object sender, RoutedEventArgs e)
        {
            var messageBoxResult = MessageBox.Show("Are you sure you want to delete all completed dowloads from Mackerel's download list?", "Confirm deletion of downloads", MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                Mackerel.RemoveCompletedDownloads();
            }
        }
Esempio n. 4
0
        void StopSelectedDownloads_Click(object sender, RoutedEventArgs e)
        {
            var           SelectedDownloads = (dynamic)DownloadList.SelectedItems;
            List <string> DownloadIDs       = new List <string>();

            for (int i = 0; i < SelectedDownloads.Count; i++)
            {
                var selectedItem = (dynamic)DownloadList.SelectedItems[i];
                DownloadIDs.Add(selectedItem.DownloadID);
            }
            Mackerel.StopDownload(DownloadIDs.ToArray());             //send a string of DownloadIDs for stopping

            EnableDisableButtonsOnCondition();
        }
Esempio n. 5
0
        void DeleteSelectedDownloads_Click(object sender, RoutedEventArgs e)
        {
            var SelectedDownloads      = (dynamic)DownloadList.SelectedItems;
            var SelectedDownloadsCount = SelectedDownloads.Count;

            if (Properties.Settings.Default.DisplayDialogforCompletedDeletions == true)
            {
                Dialogs.Warnings.ConfirmDeletion window;                 //variable creation
                if (SelectedDownloadsCount == 1)
                {
                    window = new Dialogs.Warnings.ConfirmDeletion("The selected download is not complete. Are you sure you want to delete it from the list of downloads?", "Confirm deletion of downloads");
                }
                else
                {
                    window = new Dialogs.Warnings.ConfirmDeletion("The selected downloads are not complete. Are you sure you want to delete them from the list of downloads?", "Confirm deletion of downloads");
                }
                window.Owner = this;
                window.ShowDialog();                 //show dialog
                if (window.Yes == true)
                {
                    if (window.DontShowCheckbox)                     // if don't show checkbox is checked, then set this property to false
                    {
                        Properties.Settings.Default.DisplayDialogforCompletedDeletions = false;
                        Properties.Settings.Default.Save();                         // save preference immediately
                    }
                    List <string> DownloadIDs = new List <string>();
                    for (int i = 0; i < SelectedDownloadsCount; i++)
                    {
                        var selectedItem = (dynamic)DownloadList.SelectedItems[i];
                        DownloadIDs.Add(selectedItem.DownloadID);
                    }
                    Mackerel.RemoveDownload(DownloadIDs.ToArray());                     //send a string of DownloadIDs for deletion
                }
            }
            else
            {
                List <string> DownloadIDs = new List <string>();
                for (int i = 0; i < SelectedDownloadsCount; i++)
                {
                    var selectedItem = (dynamic)DownloadList.SelectedItems[i];
                    DownloadIDs.Add(selectedItem.DownloadID);
                }
                Mackerel.RemoveDownload(DownloadIDs.ToArray());                 //send a string of DownloadIDs for deletion
            }
        }
Esempio n. 6
0
        void StopAllDownloads_Click(object sender, RoutedEventArgs e)
        {
            Mackerel.StopAllDownloads();

            EnableDisableButtonsOnCondition();
        }