public override void doVoidPayment(Payment payment, VoidReason reason) { lock (ackLock) { VoidPaymentMessage vpm = new VoidPaymentMessage(); vpm.payment = payment; vpm.voidReason = reason; string msgId = sendObjectMessage(vpm); BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += new DoWorkEventHandler(delegate(object o, DoWorkEventArgs args) { notifyObserversPaymentVoided(payment, reason); }); if (!SupportsAcks) { bw.RunWorkerAsync(); } else { msgIdToTask.Add(msgId, bw); } } }
public override void doVoidPayment(Payment payment, VoidReason reason) { VoidPaymentMessage vpm = new VoidPaymentMessage { payment = payment, voidReason = reason }; sendObjectMessage(vpm); }
public override void doVoidPayment(Payment payment, VoidReason reason, Dictionary <string, string> extras) { VoidPaymentMessage vpm = new VoidPaymentMessage { payment = payment, voidReason = reason, passThroughValues = extras }; sendObjectMessage(vpm); }
public override void doVoidPayment(Payment payment, VoidReason reason) { VoidPaymentMessage vpm = new VoidPaymentMessage(); vpm.payment = payment; vpm.voidReason = reason; sendObjectMessage(vpm); BackgroundWorker bw = new BackgroundWorker(); // what to do in the background thread bw.DoWork += new DoWorkEventHandler( delegate (object o, DoWorkEventArgs args) { notifyObserversPaymentVoided(payment, reason); }); bw.RunWorkerAsync(); }