Beispiel #1
0
        public void bwAddDownloadDoWork(object sender, DoWorkEventArgs e)
        {
            string[]     urlstatus;
            WgetDownload wgetd = new WgetDownload((string)e.Argument);

            urlstatus = wgetd.Start();
            object[] res = new object[2];
            res[0]   = urlstatus;
            res[1]   = wgetd;
            e.Result = res;
        }
Beispiel #2
0
 private void TestConnection()
 {
     try
     {
         SshExec exec = WgetDownload.SshConnect(txtSshHost.Text, int.Parse(txtSshPort.Text), txtSshLogin.Text,
                                                txtSshPass.Text, txtSshKey.Text);
         string server = exec.ServerVersion;
         exec.Close();
         MessageBox.Show(Localization.GetString("Ok") + "\r\n" + server, Localization.GetString("TestConnection"), MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Localization.GetString("TestConnection"), MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #3
0
        private void bwAddDownloadCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            string[]     urlstatus = (string[])((object[])e.Result)[0];
            WgetDownload wgetd     = (WgetDownload)((object[])e.Result)[1];

            if (urlstatus[1] != Constants.pid_error)
            {
                ListViewItem download = new ListViewItem(urlstatus);
                download.Tag = wgetd;
                if (download.SubItems[0].Text.Length > download.SubItems[1].Text.Length + 3)
                {
                    download.SubItems[0].Text = download.SubItems[0].Text.Substring(0, download.SubItems[1].Text.Length) + "...";
                }
                download.ToolTipText = wgetd.Url;
                lstDowndloads.Items.Add(download);
                lstDowndloads.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            }
            SetColors();
            return;
        }