public MultipleItemGather(Type[] types, IPortReceive[] ports, int itemCount, Handler<ICollection[]> handler)
{
if (types == null)
throw new ArgumentNullException("types");
if (ports == null)
throw new ArgumentNullException("ports");
if (handler == null)
throw new ArgumentNullException("handler");
if (types.Length == 0)
throw new ArgumentOutOfRangeException ("types");
if (ports.Length == 0)
throw new ArgumentOutOfRangeException ("ports");
if (types.Length != ports.Length)
throw new ArgumentOutOfRangeException ("types");
this.types = types;
this.ports = ports;
this.itemCount = itemCount;
this.handler = handler;
this.results = new List<object>[ports.Length];
for (int i = 0; i < ports.Length; ++i)
this.results [i] = new List<object> ();
}