/// <summary> /// Returns a new <see cref="CompositeHandler"/> that is a clone of /// this <see cref="CompositeHandler"/>. /// </summary> /// <returns>A new <see cref="CompositeHandler"/> contained cloned instances /// of all child <see cref="IJobResultsHandler"/>s.</returns> public object Clone() { CompositeHandler h = new CompositeHandler(); foreach (IJobResultsHandler handler in this) { h.Add((IJobResultsHandler)h.Clone()); } return(h); }
/// <summary> /// Creates a composite results handler from the given set of /// identifiers. /// </summary> /// <param name="identifiers">The set of identifiers for each handler /// to create.</param> /// <returns>The <see cref="IJobResultsHandler"/> representing the /// composite handler.</returns> public IJobResultsHandler CreateHandler(params string[] identifiers) { if (identifiers == null || identifiers.Length == 0) { return(new CompositeHandler()); } else { CompositeHandler handler = new CompositeHandler(); identifiers.ForEach(x => handler.Add(CreateHandler(x))); return(handler); } }