コード例 #1
0
ファイル: UDPPanel.cs プロジェクト: zhujingcheng/CP3
        public void HandleClick(Object sender, EventArgs e)
        {
            if (m_Startup.InvisibleConnectedClassroom != null)
            {
                using (Synchronizer.Lock(m_Startup.InvisibleConnectedClassroom.SyncRoot)) {
                    m_Startup.InvisibleConnectedClassroom.Connected = false;
                    m_Startup.InvisibleConnectedClassroom           = null;
                }
            }

            using (Synchronizer.Lock(this.m_Classroom.SyncRoot)) {
                this.m_Classroom.Connected = this.Checked;
                if (this.Checked)
                {
                    for (int i = 0; i < this.m_Startup.m_Connection.m_PresentationsPanel.Controls.Count; i++)
                    {
                        if (this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i] is RadioButton)
                        {
                            using (Synchronizer.Lock(((PresentationRadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).m_Classroom.SyncRoot)) {
                                if (!(this.m_Classroom == ((PresentationRadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).m_Classroom))
                                {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).Checked = false;
                                }
                                else
                                {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).Checked = true;
                                }
                            }
                        }
                    }
                    for (int i = 0; i < this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls.Count; i++)
                    {
                        if (this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i] is ManualConnectionPanel.ManualConnectionRadioButton)
                        {
                            using (Synchronizer.Lock(((ManualConnectionPanel.ManualConnectionRadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Classroom.SyncRoot)) {
                                if (!(this.m_Classroom == ((ManualConnectionPanel.ManualConnectionRadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Classroom))
                                {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Checked = false;
                                }
                                else
                                {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Checked = true;
                                }
                            }
                        }
                    }

                    this.m_PresentationHelper = new UDPPresentationCollectionHelper(this, this.m_Classroom);//This will set the association of the StartJoinButton
                }
            }
        }
コード例 #2
0
ファイル: UDPPanel.cs プロジェクト: ClassroomPresenter/CP3
        public void HandleClick(Object sender, EventArgs e)
        {
            if (m_Startup.InvisibleConnectedClassroom != null) {
                using (Synchronizer.Lock(m_Startup.InvisibleConnectedClassroom.SyncRoot)) {
                    m_Startup.InvisibleConnectedClassroom.Connected = false;
                    m_Startup.InvisibleConnectedClassroom = null;
                }
            }

            using (Synchronizer.Lock(this.m_Classroom.SyncRoot)) {
                this.m_Classroom.Connected = this.Checked;
                if (this.Checked) {
                    for (int i = 0; i < this.m_Startup.m_Connection.m_PresentationsPanel.Controls.Count; i++) {
                        if (this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i] is RadioButton) {
                            using (Synchronizer.Lock(((PresentationRadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).m_Classroom.SyncRoot)) {
                                if (!(this.m_Classroom == ((PresentationRadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).m_Classroom)) {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).Checked = false;
                                    } else {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_PresentationsPanel.Controls[i])).Checked = true;
                                    }
                                }
                            }
                        }
                    for (int i = 0; i < this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls.Count; i++) {
                        if (this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i] is ManualConnectionPanel.ManualConnectionRadioButton) {
                            using (Synchronizer.Lock(((ManualConnectionPanel.ManualConnectionRadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Classroom.SyncRoot)) {
                                if (!(this.m_Classroom == ((ManualConnectionPanel.ManualConnectionRadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Classroom)) {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Checked = false;
                                } else {
                                    ((RadioButton)(this.m_Startup.m_Connection.m_ManualConnectionPanel.Controls[i])).Checked = true;
                                }
                            }
                        }
                    }

                    this.m_PresentationHelper = new UDPPresentationCollectionHelper(this, this.m_Classroom);//This will set the association of the StartJoinButton
                    }
                }
        }