private void Cancel_Click(object sender, EventArgs e) { if (!_allowCancel) { return; } _startCancel = true; Canceling?.Invoke(this, (CancelEventArgs)e); _finishCancel = true; DialogResult = DialogResult.Cancel; }
public override ByteBuffer ToBufferRaw(ByteBuffer buffer = null) { buffer = buffer ?? new ByteBuffer(ByteBuffer.LITTLE_ENDING); Fee.ToBuffer(buffer); Canceling.ToBuffer(buffer); Player.ToBuffer(buffer); Tournament.ToBuffer(buffer); buffer.WriteArray(Extensions, (b, item) => { if (!item.IsNull()) { ; } }); // todo return(buffer); }
public Translation GetTranslation() { if (translation == null) { translation = new Translation(AppID, SecretKey) { Length = Length, }; translation.LengthChange += (sender, e) => { Length = translation.Length; if (Length >= 1998620) { translation.Cancel = Stop; } }; translation.Canceled += (sender, e) => { Canceling?.Invoke(this, new EventArgs()); }; } return(translation); }
/// <summary> /// Run when the Cancel method is called. /// Call: Canceling (event) /// </summary> protected virtual void OnCancel() { Canceling?.Invoke(); }