public DownloadItem(int index, string basePath, UpdateNotify Func, Track track = null, string quality = "LOW", Video video = null, string resolution = "720") { TidalVideo = video; TidalTrack = track; Quality = quality; Resolution = resolution; BasePath = basePath; Index = index; Errlabel = ""; Progress = new ProgressHelper(); UpdataFunc = Func; if (TidalTrack != null) { Title = track.Title; Duration = track.SDuration; sType = "Track"; } else { Title = video.Title; Duration = video.SDuration; sType = "Video"; } }
public void upCheckNotify() { UpdateNotify notify = new UpdateNotify(doCheckNotify); this.Invoke(notify); //this.BeginInvoke(notify); }
private static void FormShow(bool Show) { Form form = null; lock (lockObj) { form = Application.OpenForms["FormReconnect"]; if (form == null) { instance = new FormReconnect(); form = instance; } } if (form.InvokeRequired) { UpdateNotify ph = new UpdateNotify(FormShow); form.Invoke(ph, Show); } else { if (Show) { if (!form.Created) { form.TopMost = true; form.WindowState = FormWindowState.Maximized; form.ShowDialog(); } } else { if (form.Created) { form.Close(); } } } }
private static void NotifyUpdate(bool EMO) { Form form = Application.OpenForms["FormReconnect"]; Label emo; if (form == null) { return; } emo = form.Controls.Find("EMO_lb", true).FirstOrDefault() as Label; if (emo == null) { return; } if (emo.InvokeRequired) { UpdateNotify ph = new UpdateNotify(NotifyUpdate); emo.Invoke(ph, EMO); } else { Label cntdw = form.Controls.Find("Countdown_lb", true).FirstOrDefault() as Label; if (EMO) { emo.Visible = true; cntdw.Visible = false; } else { emo.Visible = false; cntdw.Visible = true; } } }