示例#1
0
        public frmDownload(DownloadTask downloadTask)
        {
            InitializeComponent();
            this.downloadTask = downloadTask;
            timer             = new Timer();
            timer.Tick       += Timer_Tick;
            timer.Interval    = 100;
            timer.Start();
            DownloadManager.Instance.Download(downloadTask);
            downloadTask.DownloadFinished += DownloadTask_DownloadFinished;
            downloadTask.DownloadFailture += DownloadTask_DownloadFailture;
            progressBar2.Maximum           = 100;
            changeButtonTextDelegate       = new ChangeButtonTextDelegate(ChangeButtonTextDelegateMethod);
            closeFormDelegate              = new CloseFormDelegate(CloseFormDelegateMethod);

            InitLanguageOptions();
        }
示例#2
0
 private void ChangeButtonText(Button button, String Text)
 {
     if (this.InvokeRequired)
     {
         ChangeButtonTextDelegate d = new ChangeButtonTextDelegate(ChangeButtonText);
         this.Invoke(d, button, Text);
     }
     else
         button.Text = Text;
 }