Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 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);
     }
 }