/// <summary> /// Initializes a new instance of the <see cref="JobTicket"/> class. /// </summary> /// <param name="req">The <see cref="JobRequest"/> this ticket /// represents within the queue.</param> /// <param name="handler">The first element in the chain of objects /// that handles this <see cref="JobTicket"/> being cancelled.</param> /// <exception cref="ArgumentNullException">req is null.</exception> public JobTicket(JobRequest req, ITicketCancellationHandler handler) { if (req == null) { throw new ArgumentNullException("req"); } if (handler == null) { throw new ArgumentNullException("handler"); } Request = req; Cancelled = false; JobID = Guid.NewGuid(); _sink = new EventSinkContainer <TicketSink>(); }
public Ticket() { _sinks = new EventSinkContainer <TicketSink>(); }