示例#1
0
        /// <summary>
        /// This method is called when RTP session sees new remote participant.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">Event data.</param>
        private void m_pSession_NewParticipant(object sender, RTP_ParticipantEventArgs e)
        {
            if (m_IsDisposed)
            {
                return;
            }

            e.Participant.Removed       += new EventHandler(Participant_Removed);
            e.Participant.SourceAdded   += new EventHandler <RTP_SourceEventArgs>(Participant_SourceAdded);
            e.Participant.SourceRemoved += new EventHandler <RTP_SourceEventArgs>(Participant_SourceRemoved);

            // Move processing to UI thread.
            this.BeginInvoke(new MethodInvoker(delegate(){
                TreeNode nodeParticipant = new TreeNode(e.Participant.CNAME);
                nodeParticipant.Tag      = new RTP_ParticipantInfo(e.Participant);
                nodeParticipant.Nodes.Add("Sources");
                m_pParticipants.Nodes.Add(nodeParticipant);
            }));
        }
        /// <summary>
        /// This method is called when RTP session sees new remote participant.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">Event data.</param>
        private void m_pSession_NewParticipant(object sender, RTP_ParticipantEventArgs e)
        {
            if (m_IsDisposed)
            {
                return;
            }

            e.Participant.Removed += Participant_Removed;
            e.Participant.SourceAdded += Participant_SourceAdded;
            e.Participant.SourceRemoved += Participant_SourceRemoved;

            // Move processing to UI thread.
            BeginInvoke(new MethodInvoker(delegate
                                              {
                                                  TreeNode nodeParticipant = new TreeNode(e.Participant.CNAME);
                                                  nodeParticipant.Tag = new RTP_ParticipantInfo(e.Participant);
                                                  nodeParticipant.Nodes.Add("Sources");
                                                  m_pParticipants.Nodes.Add(nodeParticipant);
                                              }));
        }