Example #1
0
 internal static bool CanConnectImpl(
     IOutputValuePort source, IInputValuePort destination, bool checkExistence = true)
 {
     if (checkExistence && !Exist(source, destination))
     {
         return(false);
     }
     return(destination.ValueType.IsAssignableFrom(source.ValueType));
 }
Example #2
0
 internal static bool DisconnectImpl(
     IOutputValuePort source, IInputValuePort destination, Action <ValueConnection> preAction)
 {
     return(Connection.DisconnectImpl(source, destination, preAction));
 }
Example #3
0
 internal static ValueConnection ConnectImpl(
     IOutputValuePort source, IInputValuePort destination, Action <ValueConnection> postAction)
 {
     return(ConnectImpl((src, dst) => new ValueConnection(src, dst), source, destination, postAction));
 }
Example #4
0
 /// <summary>
 ///     Get a value indicates whether the specified ports can be connected.
 ///     This method is equivalent to <see cref="IInputFlowPort.CanConnect(IOutputFlowPort)" /> and
 ///     <see cref="IOutputFlowPort.CanConnect(IInputFlowPort)" />.
 /// </summary>
 /// <param name="source">The source port of the desired connection.</param>
 /// <param name="destination">The destination port of the desired connection.</param>
 /// <returns>
 ///     <see langword="true" /> if the specified ports can be connected; otherwise, <see langword="false" />.
 /// </returns>
 public static bool CanConnect(IOutputValuePort source, IInputValuePort destination)
 {
     return(CanConnectImpl(source, destination));
 }
Example #5
0
 internal ValueConnection(IOutputValuePort source, IInputValuePort destination) : base(source, destination)
 {
 }
Example #6
0
 public static IEnumerable <IOutputValuePort> GetConnectedPorts(this IInputValuePort self)
 {
     return(self.Connections.Select(c => c.Source));
 }