private static void fixChannelReferences(ChannelCollection <IChannel> collection, ChannelReferencesCollection reference, Dictionary <string, IChannel> lookup) { for (int k = 0; k < reference.Count; k++) { if (!lookup.ContainsKey(reference[k].Name)) { throw new KeyNotFoundException(string.Format("Channel '{0}' undefined.", reference[k].Name)); } collection.Add(lookup[reference[k].Name]); } }
public ProcessingUnit() { InputChannels = new ChannelCollection <IChannel>(1); OutputChannels = new ChannelCollection <IChannel>(Multiplicity.Many); ControlChannels = new ChannelCollection <IChannel>(1); }