Esempio n. 1
0
        void OnLetUp(object sender, LetTypes type)
        {
            if (sender != m_currentSelectedLet)
            {
                Let senderLet = (Let)sender;
                if (senderLet.Owner != m_currentSelectedLet.Owner)
                {
                    if ((m_currentSelectedLet.Type == LetTypes.INLET && type == LetTypes.OUTLET) ||
                        (m_currentSelectedLet.Type == LetTypes.OUTLET && type == LetTypes.INLET))
                    {
                        Let inlet  = null;
                        Let outlet = null;

                        if (m_currentSelectedLet.Type == LetTypes.INLET)
                        {
                            inlet  = m_currentSelectedLet;
                            outlet = (Let)sender;
                        }
                        else
                        {
                            outlet = m_currentSelectedLet;
                            inlet  = (Let)sender;
                        }

                        if (!inlet.Contains(outlet) &&
                            !outlet.Contains(inlet))
                        {
                            Connection connection = new Connection((Inlet)inlet, (Outlet)outlet, m_livePoints);
                            inlet.Connections.Add(connection);
                            outlet.Connections.Add(connection);

                            if (Application.isPlaying)
                            {
                                ((Outlet)outlet).MakeConnections();
                                //   ((Outlet)outlet).Emit += ((Inlet)inlet).Slot;
                            }
                        }
                        else
                        {
                        }

                        m_livePoints.Clear();
                        m_currentMouseMode = MouseModes.IDLE;
                    }
                }
            }
        }