private void button1_Click(object sender, EventArgs e) { var uri = new Uri(textBox1.Text); var dest = new DirectoryInfo(".\\Downloads"); if (!dest.Exists) dest.Create(); var item = new DownloadItem(uri, dest); if (textBox2.Text.Length > 0) { item.Referer = textBox2.Text; textBox2.Text = ""; } d.Add(item); textBox1.Text = ""; }
public void Add(DownloadItem item) { q.Enqueue(item); }