Esempio n. 1
0
        private void btPlay_Click(object sender, EventArgs e)
        {
            btPlay.Enabled = false;
            var controller = new DownloadController();

            controller.DownloadAndWriteCompleted += DownloadCompleted;
            controller.Download(podcastEpisode.PlayURL);
        }
Esempio n. 2
0
        private void SearchListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            FileComponent file = SearchController.SelectedItem;

            if (file == null)
            {
                return;
            }

            DownloadController.Download(file);
        }
Esempio n. 3
0
        private void BrowseTreeView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            TreeListItem item = WpfUtil.GetTreeListItem(e.OriginalSource);

            if (item == null)
            {
                return;
            }

            BrowseComponent browse = BrowseController.SelectedItem;

            if (browse != null)
            {
                if (browse.File)
                {
                    DownloadController.Download(browse);
                }
                else
                {
                    TreeNode node = BrowseTreeView.SelectedNode;

                    if (node != null)
                    {
                        if (Application.Current != null)
                        {
                            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
                            {
                                BrowseTreeView.SetIsExpanded(node, !node.IsExpanded);
                            }));
                        }
                    }
                }
            }

            BrowseTreeView.UnselectAll();
        }
Esempio n. 4
0
        public void Test_Download_Returns_File()
        {
            var result = controller.Download("test.txt") as FileResult;

            Assert.AreEqual("test.txt", result.FileDownloadName);
        }
 private void BtnInitDownload_Click(object sender, RoutedEventArgs e) => _controller.Download();