protected void btnNo_Click(object sender, EventArgs e) { if (No != null) { No.Invoke(this, e); } }
private void textBox_PreviewKeyDown(object sender, KeyEventArgs e) { if ((e.Key == Key.B) && (YesBind != null)) { YesBind.Invoke(this, new EventArgs()); } else if ((e.Key == Key.Y) && (Yes != null)) { Yes.Invoke(this, new EventArgs()); } else if (((e.Key == Key.N) || (e.Key == Key.Enter) || (e.Key == Key.Space)) && (No != null)) { No.Invoke(this, new EventArgs()); } else if ((e.Key == Key.Escape) && (Cancel != null)) { Cancel.Invoke(this, new EventArgs()); } e.Handled = true; }
private void Start() { YesBut.onClick.AddListener(() => { if (Yes != null) { Yes.Invoke(); } Alerts.AlertCall.DownloadAlert.SetTrigger("Hide"); Yes.RemoveAllListeners(); No.RemoveAllListeners(); }); NoBut.onClick.AddListener(() => { if (No != null) { No.Invoke(); } Alerts.AlertCall.DownloadAlert.SetTrigger("Hide"); Yes.RemoveAllListeners(); No.RemoveAllListeners(); }); }