Esempio n. 1
0
        private void menuSettingsNetworkDiagnostics_Click(object sender, System.EventArgs e)
        {
            if (stoplight != null)
            {
                stoplight.Dispose();
            }

            // Create a new one each time
            stoplight = new frmStopLight();
            stoplight.WindowState = FormWindowState.Normal;
            stoplight.Show();
        }
Esempio n. 2
0
        private void FMain_Load(object sender, System.EventArgs e)
        {
            // display Recording Notification
            if (!System.Diagnostics.Debugger.IsAttached && recordNotify)
            {
                frmNotification notification = new frmNotification();
                notification.ShowDialog();
            }

            Cursor = Cursors.AppStarting;

            // Hook up this form to ConferenceAPI so it knows where to post back Events so they occur on the form thread.
            DisplayStatusInProgress("Loading ConferenceAPI.");

            Conference.CallingForm = this;

            // Set the default Conferencing behavior
            Conference.AutoPlayLocal = true;
            Conference.AutoPlayRemote = true;
            Conference.AutoPosition = Conference.AutoPositionMode.FourWay;

            // Hook the Conference events to this form's events
            Conference.ParticipantAdded += new Conference.ParticipantAddedEventHandler(OnParticipantAdded);
            Conference.ParticipantRemoved += new Conference.ParticipantRemovedEventHandler(OnParticipantRemoved);
            Conference.CapabilityAdded += new CapabilityAddedEventHandler(OnCapabilityAdded);
            Conference.CapabilityRemoved += new CapabilityRemovedEventHandler(OnCapabilityRemoved);
            Conference.DuplicateIdentityDetected += new Conference.DuplicateIdentityDetectedEventHandler(OnDuplicateIdentityDetected);

            // Make use of the internal socket exceptions to determine network status
            RtpEvents.HiddenSocketException += new RtpEvents.HiddenSocketExceptionEventHandler(HiddenSockExHandler);

            #region Load Settings from Registry
            try
            {
                // Load the form location settings from the registry
                object val;

                if ((val = cxpclientRegKey.GetValue("Top")) != null)
                {
                    this.Top = Convert.ToInt32(val);
                }
                else
                {
                    this.Top = SystemInformation.WorkingArea.Top;
                }

                if ((val = cxpclientRegKey.GetValue("Left")) != null)
                {
                    this.Left = Convert.ToInt32(val);
                }
                else
                {
                    this.Left = SystemInformation.WorkingArea.Right - this.Width;
                }

                if ((val = cxpclientRegKey.GetValue("Width")) != null)
                {
                    this.Width = Convert.ToInt32(val);
                }

                if ((val = cxpclientRegKey.GetValue("Height")) != null)
                {
                    this.Height = Convert.ToInt32(val);
                }

                if ((val = cxpclientRegKey.GetValue("AutoPlayRemote")) != null)
                {
                    Conference.AutoPlayRemote = Convert.ToBoolean(val);
                }

                if ((val = cxpclientRegKey.GetValue("AutoPlayLocal")) != null)
                {
                    Conference.AutoPlayLocal = Convert.ToBoolean(val);
                }

                if ((val = AVReg.ReadValue(AVReg.RootKey, AVReg.AutoPlayRemoteAudio)) != null)
                {
                    autoPlayRemoteAudio = bool.Parse((string)val);
                }

                if ((val = AVReg.ReadValue(AVReg.RootKey, AVReg.AutoPlayRemoteVideo)) != null)
                {
                    autoPlayRemoteVideo = bool.Parse((string)val);
                }

                if ((val = cxpclientRegKey.GetValue("AutoPosition")) != null)
                {
                    Conference.AutoPosition = (Conference.AutoPositionMode)Enum.Parse(Conference.AutoPosition.GetType(), val.ToString());
                }
            }
            catch
            {
                // Set the default location of the form to the top right corner of the working area
                this.Top = SystemInformation.WorkingArea.Top;
                this.Left = SystemInformation.WorkingArea.Right - this.Width;
                // Width and Height defaults are set by the development environment
            }
            #endregion

            #region Set RTDocs Viewers, Services, and Check for Student Mode
            DisplayRTDocumentViewers();

            // Pre-populate Archive service if there are no entries in the registry and one is specified in app.config
            string setting = null;
            if (archiversRegKey.ValueCount == 0)
            {
                string asKey = "MSR.LST.ConferenceXP.ArchiveService";
                if ((setting = ConfigurationManager.AppSettings[asKey]) != null)
                {
                    archiversRegKey.SetValue(setting, "False");
                }

                // The next entry in the app.config starts with the postfix 2
                // i.e. - MSR.LST.ConferenceXP.ArchiveService2
                int postfix = 2;

                while ((setting = ConfigurationManager.AppSettings[asKey + postfix]) != null)
                {
                    archiversRegKey.SetValue(setting, "False");
                    postfix++; // Move to the next entry
                }
            }

            // Pre-populate Reflector service if there are no entries in the
            // registry and one (or more) is specified in app.config
            // Disabled by default
            if (reflectorsRegKey.ValueCount == 0)
            {
                string rsKey = "MSR.LST.ConferenceXP.ReflectorService";

                if ((setting = ConfigurationManager.AppSettings[rsKey]) != null)
                {
                    reflectorsRegKey.SetValue(setting, "False");
                }

                // The next entry in the app.config starts with the postfix 2
                // i.e. - MSR.LST.ConferenceXP.ReflectorService2
                int postfix = 2;

                while ((setting = ConfigurationManager.AppSettings[rsKey + postfix]) != null)
                {
                    reflectorsRegKey.SetValue(setting, "False");
                    postfix++; // Move to the next entry
                }
            }

            // Check if student mode has been configured, and disable appropriate menus if needed
            setting = ConfigurationManager.AppSettings["MSR.LST.ConferenceXP.StudentMode"];
            bStudentMode = (setting != null && bool.Parse(setting));

            if (bStudentMode)
            {
                // Disable menu settings
                menuActions.Visible = false;
                menuSettingsAudioVideo2.Visible = false;
                menuSettingsServices.Visible = false;
                menuSettingsNetworkDiagnostics.Visible = false;
                menuSettingsNetworkDiagnostics.Visible = false;
                menuMyProfile.Visible = false;
            }
            else
            {
                DisplayStatusInProgress("Loading Venues.");
                InitVenueService();
                GetArchiveService();
                SetReflectorService();
                DisplayOtherCapabilitySenders();
                SetDefaultDevices();
            }
            #endregion

            InvokeActionArguments(arguments.Parameters);

            if (bStudentMode && Conference.ActiveVenue == null)
            {
                // Create a custom venue and enter it
                JoinVenue(AddLocalVenue(), false);
            }

            // Auto-start the connectivity detector, if it's set to
            setting = ConfigurationManager.AppSettings["MSR.LST.Net.ConnectivityDetector.AutoStart"];
            if (setting != null && bool.Parse(setting))
            {
                stoplight = new frmStopLight();
            }

            // Detect whether or not the UW Classroom Presenter Capability has been installed, and if so, display it on the Actions menu
            ArrayList alCapabilitySenders = new ArrayList(Conference.OtherCapabilitySenders);
            if (alCapabilitySenders.Contains("Classroom Presenter"))
            {
                menuActionsUWClassroomPresenter.Visible = true;
            }

            // A venue may already be entered by command line parameters
            if (Conference.ActiveVenue == null)
            {
                DisplayVenues();
            }
            else
            {
                InVenueUIState();
            }

            Cursor = Cursors.Default;
        }