Exemple #1
0
        void ListenOrStopListen()
        {
            if ((tv_Sessions.SelectedNode != null) && (tv_Sessions.SelectedNode.Tag != null))
            {
                var session = (ISession)tv_Sessions.SelectedNode.Tag;
                if (session == null)
                {
                    return;
                }

                if (listened.Contains(session))
                {
                    presenter.StopListening(session);
                    btn_Listen.Text = Constants.LISTEN;
                    tv_Sessions.SelectedNode.BackColor = joined.Contains(session) ? Constants.JOINED_COLOR : tv_Sessions.BackColor;
                }
                else
                {
                    presenter.Listen(session);
                    btn_Listen.Text = Constants.STOP_LISTENING;
                    tv_Sessions.SelectedNode.BackColor = Constants.LISTENING_COLOR;
                }
            }
        }