15 lines
382 B
C#
15 lines
382 B
C#
using System;
|
|
|
|
namespace Cryville.Common {
|
|
public class AsyncDelivery<T> {
|
|
public Action CancelSource { private get; set; }
|
|
public Action<bool, T> Destination { private get; set; }
|
|
public void Deliver(bool succeeded, T result) {
|
|
if (Destination != null) Destination(succeeded, result);
|
|
}
|
|
public void Cancel() {
|
|
if (CancelSource != null) CancelSource();
|
|
}
|
|
}
|
|
}
|