private async void inputTitle_KeyPress(object sender, KeyPressEventArgs e) { if (!string.IsNullOrEmpty(inputTitle.Text)) { if (e.KeyChar == (char)Keys.Enter && CanRun()) { string title = inputTitle.Text; outputLogs.AppendText(@"Rozpoczęcie pobierania: " + title + "..." + NL + NL); YoutubeDLDownload downloader = new YoutubeDLDownload(); var output = await downloader.StartDownloadTitle(title); outputLogs.AppendText(output + NL + NL); } } }
private async void ButtonDownloadTitle_Click(object sender, EventArgs e) { if (!CanRun()) { return; } string title = inputTitle.Text; outputLogs.AppendText(@"Rozpoczęcie pobierania: " + title + "..." + NL + NL); YoutubeDLDownload downloader = new YoutubeDLDownload(); var output = await downloader.StartDownloadTitle(title); outputLogs.AppendText(output + NL + NL); }