Esempio n. 1
0
        public DownloadUpdatePage()
        {
            InitializeComponent();

            using (var metadata = Metadata.Open(Program.Arguments.Package))
            {
                _downloader = new PackageDownloader(metadata.NuGetSite, Program.Arguments.Package);
            }

            _downloader.DownloadCompleted += (s, ea) => DownloadComplete(ea.DownloadFolder);
            _downloader.DownloadFailed += (s, ea) => ShowException(ea.Exception);

            Disposed += UpdateDownloadPage_Disposed;
        }
Esempio n. 2
0
 void MainForm_Disposed(object sender, EventArgs e)
 {
     if (_downloader != null)
     {
         _downloader.Dispose();
         _downloader = null;
     }
 }
Esempio n. 3
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            NativeMethods.SetForegroundWindow(Handle);

            _downloader = new PackageDownloader(Program.Arguments.Site, Program.Arguments.Package);

            _downloader.DownloadCompleted += (s, ea) => DownloadComplete(ea.DownloadFolder);
            _downloader.DownloadFailed += (s, ea) => ShowException(ea.Exception);

            _downloader.Start();

            _timer.Start();
        }
Esempio n. 4
0
 void UpdateDownloadPage_Disposed(object sender, EventArgs e)
 {
     if (_downloader != null)
     {
         _downloader.Dispose();
         _downloader = null;
     }
 }