private void DownloadMany(object sender, RoutedEventArgs e) { if (Running) { new Msgbox(this, "其他任务正在进行!").ShowDialog(); return; } if (IsDownLoading()) { new PopupWindow(this, "请等待下载结束!").Show(); return; } WindowDownLoad WindowDownLoad = null; Window window = Jvedio.GetWindow.Get("WindowDownLoad"); if (window != null) { WindowDownLoad = (WindowDownLoad)window; WindowDownLoad.Close(); } WindowDownLoad = new WindowDownLoad(); WindowDownLoad.Show(); }
private void DownloadMany(object sender, RoutedEventArgs e) { if (Running) { HandyControl.Controls.Growl.Warning("其他任务正在进行!"); return; } if (IsDownLoading()) { HandyControl.Controls.Growl.Warning("请等待下载结束!"); return; } WindowDownLoad WindowDownLoad = null; Window window = Jvedio.GetWindow.Get("WindowDownLoad"); if (window != null) { WindowDownLoad = (WindowDownLoad)window; WindowDownLoad.Close(); } WindowDownLoad = new WindowDownLoad(); WindowDownLoad.Show(); }
public bool IsDownLoading() { bool result = false; Main main = null; Window window = Jvedio.GetWindow.Get("Main"); if (window != null) { main = (Main)window; } WindowDownLoad WindowDownLoad = null; window = Jvedio.GetWindow.Get("WindowDownLoad"); if (window != null) { WindowDownLoad = (WindowDownLoad)window; } if (main?.DownLoader != null) { if (main.DownLoader.State == DownLoadState.DownLoading | main.DownLoader.State == DownLoadState.Pause) { Console.WriteLine("main.DownLoader.State " + main.DownLoader.State); result = true; } } if (WindowDownLoad?.MultiDownLoader != null) { if (WindowDownLoad.MultiDownLoader.State == DownLoadState.DownLoading | WindowDownLoad.MultiDownLoader.State == DownLoadState.Pause) { Console.WriteLine("WindowDownLoad.MultiDownLoader.State " + WindowDownLoad.MultiDownLoader.State); result = true; } } return(result); }