예제 #1
0
파일: Connection.cs 프로젝트: xenosl/ShuHai
 public static bool CanConnect(IOutputPort source, IInputPort destination)
 {
     if (source is IOutputFlowPort flowSrc && destination is IInputFlowPort flowDst)
     {
         return(FlowConnection.CanConnect(flowSrc, flowDst));
     }
     if (source is IOutputValuePort valueSrc && destination is IInputValuePort valueDst)
     {
         return(ValueConnection.CanConnect(valueSrc, valueDst));
     }
     return(false);
 }
예제 #2
0
파일: Connection.cs 프로젝트: xenosl/ShuHai
 protected internal static bool CanConnectImpl(
     IOutputPort source, IInputPort destination, bool checkExistence = true)
 {
     if (source is IOutputFlowPort flowSrc && destination is IInputFlowPort flowDst)
     {
         return(FlowConnection.CanConnectImpl(flowSrc, flowDst, checkExistence));
     }
     if (source is IOutputValuePort valueSrc && destination is IInputValuePort valueDst)
     {
         return(ValueConnection.CanConnectImpl(valueSrc, valueDst, checkExistence));
     }
     return(false);
 }