예제 #1
0
        /// <summary>
        /// btnStartRecording Click event handler. Start the conference recording.
        /// </summary>
        /// <param name="sender">The event sender object</param>
        /// <param name="e">The event arguments</param>
        private void btnStartRecording_Click(object sender, System.EventArgs e)
        {
            // Debug.Assert: In theory the condition txtConferenceName.Text.Length < 1 should never be valid because
            //               the Start Recoding button is disabled when there is no character.
            //               I also limited the MaxLenght of the txtConferenceName textbox to 254.
            Debug.Assert(1 <= txtConferenceName.Text.Length && txtConferenceName.Text.Length < 255);

            try
            {
                refFMain.StartRecording(txtConferenceName.Text);
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(this,
                                "You cannot play back a recorded conference at this time. Make sure \n" +
                                "there currently is no recording or playback in this venue. \n" +
                                "\nException Message: " + ex.Message,
                                "Playback Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;                  // leave everything unchanged...
            }
            catch (ArgumentException ex) // IPv6 error
            {
                string errorMsg = ex.Message;
                if (errorMsg.IndexOf("IPv6") > -1)
                {
                    MessageBox.Show(this, errorMsg, "Address Protocol Error",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    string error = frmArchiveClient.GenericPlaybackError + ex.ToString();
                    MessageBox.Show(this, error, frmArchiveClient.GenericPlaybackErrorTitle,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                return; // leave everything unchanged...
            }
            catch (Exception ex)
            {
                string error = frmArchiveClient.GenericPlaybackError + ex.ToString();
                MessageBox.Show(this, error, frmArchiveClient.GenericPlaybackErrorTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return; // leave everything unchanged...
            }

            btnStartRecording.Enabled = false;
            btnStopRecording.Enabled  = true;
            txtConferenceName.Enabled = false;

            // Note: Once the recording start you can not cancel it
            //       In fact, if we wanted to implement cancel here, we would
            //       need to remove the new data on the SQL server when cancel and make
            //       we are exactly on the same state than before starting recording
            btnCancel.Enabled = false;

            startPlayBackTicks      = DateTime.Now.Ticks;
            timerUpdateTime.Enabled = true;
        }
예제 #2
0
        /// <summary>
        /// btnStartRecording Click event handler. Start the conference recording.
        /// </summary>
        /// <param name="sender">The event sender object</param>
        /// <param name="e">The event arguments</param>
        private void btnStartRecording_Click(object sender, System.EventArgs e)
        {
            // Debug.Assert: In theory the condition txtConferenceName.Text.Length < 1 should never be valid because
            //               the Start Recoding button is disabled when there is no character.
            //               I also limited the MaxLenght of the txtConferenceName textbox to 254.
            Debug.Assert(1 <= txtConferenceName.Text.Length && txtConferenceName.Text.Length < 255);

            try
            {
                refFMain.StartRecording(txtConferenceName.Text);

                btnStartRecording.Enabled = false;
                btnStopRecording.Enabled  = true;
                txtConferenceName.Enabled = false;

                // Note: Once the recording start you can not cancel it
                //       In fact, if we wanted to implement cancel here, we would
                //       need to remove the new data on the SQL server when cancel and make
                //       we are exactly on the same state than before starting recording
                btnCancel.Enabled = false;

                startPlayBackTicks      = DateTime.Now.Ticks;
                timerUpdateTime.Enabled = true;
            }
            catch (ArchiveService.PlaybackInProgressException)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.PlaybackErrorText, Strings.PlaybackOngoingError), Strings.PlaybackErrorTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
            }
            catch (InvalidOperationException ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture, Strings.PlaybackErrorText,
                                                            ex.Message), Strings.PlaybackErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error,
                                        MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }
            catch (ArgumentException ex) // IPv6 error
            {
                string errorMsg = ex.Message;
                if (errorMsg.IndexOf("IPv6") > -1)
                {
                    RtlAwareMessageBox.Show(this, errorMsg, Strings.AddressProtocolError, MessageBoxButtons.OK,
                                            MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                }
                else
                {
                    string error = string.Format(CultureInfo.CurrentCulture, Strings.ArchiveServiceErrorText,
                                                 ex.ToString());
                    RtlAwareMessageBox.Show(this, error, Strings.ArchiveServiceErrorTitle, MessageBoxButtons.OK,
                                            MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                }
            }
            catch (Exception ex)
            {
                string error = string.Format(CultureInfo.CurrentCulture, Strings.ArchiveServiceErrorText,
                                             ex.ToString());
                RtlAwareMessageBox.Show(this, error, Strings.ArchiveServiceErrorTitle, MessageBoxButtons.OK,
                                        MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }
        }