예제 #1
0
        public void DownloadFile(string url, string file)
        {
            // Create a download item.
            Download download = new Download(url, file);
            // If the same file had previously been downloaded,
            // let the old one assume the identity of the new.
            Download existingDownload = _downloads.SingleOrDefault(d => d == download);

            // Show the downloads bar.
            //DownloadsVisible = true;

            if (existingDownload != null)
            {
                download = existingDownload;
            }
            else
            {
                _downloads.Add(download);
            }

            // Start downloading.
            download.Start();
            // Show the Downloads window.
            DownloadsWindow.Show(dockPanel);
        }
예제 #2
0
 private void downloadsToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
 {
     if (downloadsToolStripMenuItem.Checked)
     {
         DownloadsWindow.Show(dockPanel);
     }
     else
     {
         DownloadsWindow.Hide();
     }
 }
예제 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (Settings.Default.Downloads)
            {
                DownloadsWindow.Show(dockPanel);
            }

            // Create the initial tab.
            this.OpenTab();
        }
예제 #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // Initialize UI.
            if (Settings.Default.History)
            {
                History.Show(dockPanel);
            }

            if (Settings.Default.Downloads)
            {
                DownloadsWindow.Show(dockPanel);
            }

            // Create the initial tab.
            OpenTab();

            // Refresh history entries.
            History.RefreshSource();
        }
예제 #5
0
 private void OnDownloadBegin(object sender, DownloadBeginEventArgs e)
 {
     DownloadsWindow.Show(dockPanel, DockState.DockBottom);
 }