/// <summary> /// Initializes a new instance of the <see cref="JobResult"/> class, /// representing a complete job. /// </summary> /// <param name="images">The set of processed images returned by /// the service.</param> /// <exception cref="ArgumentNullException">images is null.</exception> public JobResult(IEnumerable <IProcessedImage> images) { if (images == null) { throw new ArgumentNullException("images"); } Images = new ProcessedImageSet(images); Result = JobState.Complete; }
/// <summary> /// Initializes a new instance of the <see cref="JobResult"/> class, /// representing a job that encountered an error. /// </summary> /// <param name="err">The <see cref="Exception"/> that caused the /// job to terminate.</param> /// <exception cref="ArgumentNullException">err is null.</exception> public JobResult(Exception err) { if (err == null) { throw new ArgumentNullException("err"); } Exception = err; Result = JobState.Error; Images = new ProcessedImageSet(); }
/// <summary> /// Allows private construction of custom job states. /// </summary> /// <param name="state">The state to expost.</param> private JobResult(JobState state) { Result = state; Images = new ProcessedImageSet(); }