public static void ProcessCommandLine(string CommandLine) { if (Program.MainForm.InvokeRequired) { Global.InvokeOnGUI((VoidDelegateString)ProcessCommandLine, CommandLine); return; } CommandLine = CommandLine.Trim(' ', '\"'); if (CommandLine.ToLower().EndsWith(".nzb") && System.IO.File.Exists(CommandLine)) { frmAddNZB NzbForm = new frmAddNZB(CommandLine); NzbForm.StartPosition = FormStartPosition.CenterScreen; NzbForm.TopMost = true; NzbForm.Show(); } }
void AddSelectedItemsToQueue() { if (NzbResultList.SelectedIndices.Count > 0) { List<NzbItem> SelectedItems = new List<NzbItem>(); if (_FilteredList != null) { foreach (int itemIndex in NzbResultList.SelectedIndices) SelectedItems.Add(_FilteredList[itemIndex]); } else { foreach (int itemIndex in NzbResultList.SelectedIndices) SelectedItems.Add(_provider[itemIndex]); } frmAddNZB frm = new frmAddNZB(_provider, SelectedItems); DialogResult res = frm.ShowDialog(); if (res == DialogResult.OK) { if (_FilteredList == null) { foreach (int itemIndex in NzbResultList.SelectedIndices) _ListCache[itemIndex].BackColor = _provider[itemIndex].BackgroundColor; } else NzbResultList.Refresh(); foreach (NzbItem item in SelectedItems) UpdateLatestDownload(item); //cboSABcat.Text = frm.SABcat; } } }