private void RestoreDetachedPort()
        {
            if (m_DetachedFromInputPort)
            {
                m_Edge.input = m_DetachedPort;

                m_DetachedPort.Connect(m_Edge);

                foreach (var edge in m_AdditionalEdges)
                {
                    edge.input = m_DetachedPort;

                    m_DetachedPort.Connect(edge);
                }
            }
            else
            {
                m_Edge.output = m_DetachedPort;

                m_DetachedPort.Connect(m_Edge);

                foreach (var edge in m_AdditionalEdges)
                {
                    edge.output = m_DetachedPort;

                    m_DetachedPort.Connect(edge);
                }
            }
        }
Example #2
0
        private void RestoreDetachedPort()
        {
            if (m_DetachedFromInputPort)
            {
                m_Edge.input = m_DetachedPort;

                m_DetachedPort.Connect(m_Edge);
            }
            else
            {
                m_Edge.output = m_DetachedPort;

                m_DetachedPort.Connect(m_Edge);
            }
        }
Example #3
0
        public T ConnectTo <T>(Port other) where T : Edge, new()
        {
            if (other == null)
            {
                throw new ArgumentNullException("Port.ConnectTo<T>() other argument is null");
            }

            if (other.direction == this.direction)
            {
                throw new ArgumentException("Cannot connect two ports with the same direction");
            }

            var edge = new T();

            edge.output = direction == Direction.Output ? this : other;
            edge.input  = direction == Direction.Input ? this : other;

            this.Connect(edge);
            other.Connect(edge);

            return(edge);
        }