예제 #1
0
        public bool IsNodeChainValid(ParentNode currentNode, bool forward)
        {
            WireNode wireNode = currentNode as WireNode;

            if (wireNode == null)
            {
                return(m_clipboardAuxData.ContainsKey(currentNode.UniqueId));
            }

            if (forward)
            {
                if (wireNode.InputPorts[0].ExternalReferences.Count > 0)
                {
                    int nodeId = wireNode.InputPorts[0].ExternalReferences[0].NodeId;
                    if (m_clipboardAuxData.ContainsKey(nodeId))
                    {
                        return(IsNodeChainValid(UIUtils.GetNode(nodeId), forward));
                    }
                }
            }
            else
            {
                int nodeId = wireNode.OutputPorts[0].ExternalReferences[0].NodeId;
                if (m_clipboardAuxData.ContainsKey(nodeId))
                {
                    return(IsNodeChainValid(UIUtils.GetNode(nodeId), forward));
                }
            }
            return(false);
        }
예제 #2
0
 public WireReference FindNewValidInputNode(WireNode current)
 {
     if (current.InputPorts[0].IsConnected)
     {
         ParentNode node = UIUtils.GetNode(current.InputPorts[0].ExternalReferences[0].NodeId);
         if (node != null)
         {
             WireNode wireNode = node as WireNode;
             if (wireNode != null && wireNode.MarkToDelete)
             {
                 return(FindNewValidInputNode(wireNode));
             }
             else
             {
                 return(current.InputPorts[0].ExternalReferences[0]);
             }
         }
     }
     return(null);
 }
예제 #3
0
        public WirePortDataType GetLastInputDataTypeRecursively()
        {
            if (m_outputPorts[0].ExternalReferences.Count > 0)
            {
                WireNode rightWire = m_outputPorts[0].GetInputNode(0) as WireNode;
                if (rightWire != null)
                {
                    return(rightWire.GetLastInputDataTypeRecursively());
                }
                else
                {
                    return(m_outputPorts[0].GetInputConnection(0).DataType);
                }
            }

            if (m_containerGraph.ParentWindow.WireReferenceUtils.OutputPortReference.IsValid)
            {
                return(m_containerGraph.ParentWindow.WireReferenceUtils.OutputPortReference.DataType);
            }
            else
            {
                return(m_visualDataType);
            }
        }