/// <summary> /// Connects specified node output to current terminator. /// </summary> /// <param name="output">Output entity of node.</param> public void Add(NodeOutput output) { if (output == null) { throw new ArgumentNullException(nameof(output)); } if (output.ValueType != typeof(T)) { throw new ArgumentException(ComponentsResources.InputTypeMismatch); } output.ExceptionOccurred += RegisterException; lock (_lockGuard) { var source = output.TakeValueSource(); source.ValueReady += TryTakeValue; TryTakeValue(source); } }
/// <summary> /// Links NodeInput and NodeOutput entities by adding output source from specified output entity to list of input sources for specified input entity. /// </summary> /// <param name="input">Node input entity.</param> /// <param name="output">Node output entity.</param> public static void Add(this NodeInput input, NodeOutput output) { input.AddSource(output.TakeValueSource()); }