private void btnCancel_Click(object sender, RoutedEventArgs e) { if (CancelEvent != null) { CancelEvent.Invoke(); } }
private void State_CancelEvent() { if (CancelEvent == null || CancelEvent.Invoke()) { Dispose(); } }
/// <summary> /// Executed when the Esc button is pressed and the Escape property is true /// </summary> public virtual void OnEscape() { ModalResult = ModalWindowResult.Cancel; if (MainWindow.ActiveWindow == this) { Close(); } CancelEvent?.Invoke(); }
/// <summary> /// cancels the popup /// </summary> public virtual void ExecuteCancel() { if (!Interactable) { return; } Interactable = false; CancelEvent?.Invoke(); Destroy(); }
private void GridWindow_OnMouseUp(object sender, MouseButtonEventArgs e) { if (okImageState == ImageState.Focus) { OkEvent?.Invoke(sender, new OkEventArgs()); } else if (cancelImageState == ImageState.Focus) { CancelEvent?.Invoke(sender, new OkEventArgs()); } }
private async void DownLoadExtraPic(DetailMovie dm) { List <string> urlList = dm.extraimageurl?.Split(';').Where(arg => arg.IsProperUrl()).ToList(); bool dlimageSuccess = false; string cookies = ""; for (int i = 0; i < urlList.Count(); i++) { HttpStatusCode sc = HttpStatusCode.Forbidden; if (cts.IsCancellationRequested) { CancelEvent?.Invoke(this, EventArgs.Empty); break; } string filepath = ""; filepath = BasePicPath + "ExtraPic\\" + dm.id + "\\" + Path.GetFileName(new Uri(urlList[i]).LocalPath); if (!File.Exists(filepath)) { (dlimageSuccess, cookies) = await Task.Run(() => { return(MyNet.DownLoadImage(urlList[i], ImageType.ExtraImage, dm.id, Cookie: cookies, callback: (statuscode) => { sc = (HttpStatusCode)statuscode; })); }); if (dlimageSuccess) { ExtraImageDownLoadCompleted?.Invoke(this, new MessageCallBackEventArgs(filepath)); if (urlList[i].IndexOf("dmm") > 0) { Thread.Sleep(Delay.MEDIUM); } else { Thread.Sleep(Delay.SHORT_3); } } else { Logger.LogN($" {Jvedio.Language.Resources.Preview} {i + 1} {Jvedio.Language.Resources.Message_Fail}:{urlList[i]}, {Jvedio.Language.Resources.Reason} : {sc.ToStatusMessage()}"); MessageCallBack?.Invoke(this, new MessageCallBackEventArgs($" {Jvedio.Language.Resources.Preview} {i + 1} {Jvedio.Language.Resources.Message_Fail},{Jvedio.Language.Resources.Reason} :{sc.ToStatusMessage()} ,{Jvedio.Language.Resources.Message_ViewLog}")); } } lock (lockobject) Value += 1; InfoUpdate?.Invoke(this, new DetailMovieEventArgs() { DetailMovie = dm, value = Value, maximum = Maximum }); } lock (lockobject) Value = Maximum; InfoUpdate?.Invoke(this, new DetailMovieEventArgs() { DetailMovie = dm, value = Value, maximum = Maximum }); IsDownLoading = false; }
private async void DownLoadExtraPic(DetailMovie dm) { List <string> urlList = new List <string>(); foreach (var item in dm.extraimageurl?.Split(';')) { if (!string.IsNullOrEmpty(item)) { urlList.Add(item); } } bool dlimageSuccess = false; string cookies = ""; for (int i = 0; i < urlList.Count(); i++) { if (cts.IsCancellationRequested) { CancelEvent?.Invoke(this, EventArgs.Empty); break; } string filepath = ""; if (urlList[i].Length > 0) { filepath = StaticVariable.BasePicPath + "ExtraPic\\" + dm.id + "\\" + Path.GetFileName(new Uri(urlList[i]).LocalPath); if (!File.Exists(filepath)) { (dlimageSuccess, cookies) = await Task.Run(() => { return(Net.DownLoadImage(urlList[i], ImageType.ExtraImage, dm.id, Cookie: cookies)); }); if (dlimageSuccess) { Thread.Sleep(1500); } } } lock (lockobject) Value += 1; InfoUpdate?.Invoke(this, new DetailMovieEventArgs() { DetailMovie = dm, value = Value, maximum = Maximum }); } lock (lockobject) Value = Maximum; InfoUpdate?.Invoke(this, new DetailMovieEventArgs() { DetailMovie = dm, value = Value, maximum = Maximum }); IsDownLoading = false; }
public FFMpegArgumentProcessor CancellableThrough(out Action cancel, int timeout = 0) { cancel = () => CancelEvent?.Invoke(this, timeout); return(this); }
private void CancelButton_Click(object sender, RoutedEventArgs e) { CancelEvent?.Invoke(this, new EventArgs()); }
public virtual void OnCancel() { Hide(); CancelEvent?.Invoke(); }
public FFMpegArgumentProcessor CancellableThrough(out Action cancel) { cancel = () => CancelEvent?.Invoke(this, EventArgs.Empty); return(this); }
private void BackClicked(object o, EventArgs e) { CancelEvent?.Invoke(); }
private void CancelCommandExecuted(object sender, ExecutedRoutedEventArgs e) { CancelEvent?.Invoke(); }
public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0) { token.Register(() => CancelEvent?.Invoke(this, timeout)); return(this); }
private void cancelButton_Click(object sender, EventArgs e) { CancelEvent?.Invoke(); ResetControls(); }
public void RunCancel() => CancelEvent?.Invoke();
private void BtnCancel_Click(object sender, EventArgs e) { CancelEvent?.Invoke(new TabTransferDataModel("Cancel"), null); }
public void FireCancelEvent() { // we don't care about parameters since we're just closing the window on cancel CancelEvent?.Invoke(this, null); }
public virtual void CancelClick() { CancelEvent?.Invoke(); }
void buttonCancel_Click(object sender, EventArgs e) { CancelEvent?.Invoke(this, new EventArgs()); Close(); }
public void Cancel() { CancelEvent?.Invoke(); Activate(false); turnBtn.gameObject.SetActive(true); }