示例#1
0
        /// <summary>
        /// lvwConferences_Click get the streams information of the selected conference and
        /// display it in the lvwStreams list view.
        /// </summary>
        /// <param name="sender">The event sender object</param>
        /// <param name="e">The event arguments</param>
        private void lvwConferences_Click(object sender, System.EventArgs e)
        {
            try
            {
                ArchiveService.Conference conf = (ArchiveService.Conference)lvwConferences.SelectedItems[0].Tag;
                Debug.Assert(conf != null);

                if (conf != null)
                {
                    ArchiveService.Participant[] participants = archiver.GetParticipants(conf.ConferenceID);
                    lvwStreams.Items.Clear();
                    foreach (ArchiveService.Participant participant in participants)
                    {
                        ArchiveService.Stream[] streams = archiver.GetStreams(participant.ParticipantID);

                        foreach (ArchiveService.Stream s in streams)
                        {
                            // TODO: Create the string array with enum (same as frmArchiveConf)
                            // TODO: Eventually use Tag to set to the stream
                            ListViewItem stream = new ListViewItem(
                                new string[] { participant.Name, s.Name, s.Payload, s.Frames.ToString(), s.StreamID.ToString() });
                            stream.Checked = true;
                            lvwStreams.Items.Add(stream);
                        }
                    }
                }

                UpdateSelectButtonState();
            }
            catch (System.Net.Sockets.SocketException ex)
            {
                MessageBox.Show(this,
                                "The Archive Service did not respond. Make sure the Archive Service you \n" +
                                "specified in ConferenceXP is correct and that server is online. \n" +
                                "For further assistance, contact your server's administrator. \n" +
                                "\nException Message: " + ex.Message,
                                "Archive Service Unavailable", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this,
                                "The Archive Service is currently unavailable or may have encountered an \n" +
                                "unexpected error. For further assistance contact your server's administrator. \n" +
                                "\nException:\n" + ex.ToString(), "Archive Service Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// lvwConferences_Click get the streams information of the selected conference and
        /// display it in the lvwStreams list view.
        /// </summary>
        /// <param name="sender">The event sender object</param>
        /// <param name="e">The event arguments</param>
        private void lvwConferences_Click(object sender, System.EventArgs e)
        {
            try
            {
                ArchiveService.Conference conf = (ArchiveService.Conference)lvwConferences.SelectedItems[0].Tag;
                Debug.Assert(conf != null);

                if (conf != null)
                {
                    ArchiveService.Participant[] participants = archiver.GetParticipants(conf.ConferenceID);
                    lvwStreams.Items.Clear();
                    foreach (ArchiveService.Participant participant in participants)
                    {
                        ArchiveService.Stream[] streams = archiver.GetStreams(participant.ParticipantID);

                        foreach (ArchiveService.Stream s in streams)
                        {
                            // TODO: Create the string array with enum (same as frmArchiveConf)
                            // TODO: Eventually use Tag to set to the stream
                            ListViewItem stream = new ListViewItem(new string[] { participant.Name, s.Name, s.Payload,
                                                                                  s.Frames.ToString(CultureInfo.CurrentCulture), s.StreamID.ToString(CultureInfo.CurrentCulture) });
                            stream.Checked = true;
                            lvwStreams.Items.Add(stream);
                        }
                    }
                }

                UpdateSelectButtonState();
            }
            catch (System.Net.Sockets.SocketException ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchiveServiceUnavailableText, ex.Message), Strings.ArchiveServiceUnavailableTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
            }
            catch (Exception ex)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ArchiveServiceErrorText, ex.ToString()), Strings.ArchiveServiceErrorTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                        (MessageBoxOptions)0);
            }
        }