public OutputConnector AddOutput(string name, ReadOnlySpan <int> dimensions) { var conn = new OutputConnector(name, dimensions, this); _outputConnectors.Add(conn); return(conn); }
public Connection SetConnection(OutputConnector from) { if (!from.Dimensions.SequenceEqual(Dimensions)) { throw new InvalidOperationException("Dimensions must be equal."); } if (Connection != null) { if (Connection.From == from) { return(Connection); } else { ClearConnection(); } } Connection = new Connection(from, this); from.AddConnection(this); return(Connection); }
public Connection(OutputConnector from, InputConnector to) { From = from ?? throw new ArgumentNullException(nameof(from)); To = to ?? throw new ArgumentNullException(nameof(to)); }