public StreamTableElement AddMaterialStream(MaterialStream stream) { if (!Streams.Contains(stream)) { Streams.Add(stream); } else { throw new InvalidOperationException("Stream " + stream.Name + " already included in streamtable"); } return(this); }
public StreamTableElement RemoveMaterialStream(MaterialStream stream) { if (Streams.Contains(stream)) { Streams.Remove(stream); } else { throw new InvalidOperationException("Stream " + stream.Name + " not included in streamtable"); } return(this); }
public void Connect(T stream) { if (Streams.Count < Multiplicity || Multiplicity == -1) { if (!Streams.Contains(stream)) { IsConnected = true; Streams.Add(stream); } else { throw new InvalidOperationException("Stream " + stream.Name + " already connected to port " + Name); } } else { throw new InvalidOperationException("No more streams allowed for port " + Name); } }