/// <summary>
        /// Display the dialog and return the appropriate DialogResults.
        /// If the user doesn't click OK to close the dialog, return null.
        /// </summary>
        /// <param name="service">ServiceBinding used to make requests.</param>
        /// <param name="appointments">Output parameter</param>
        /// <returns>DialogResult</returns>
        public static DialogResult ShowDialog(ExchangeService service, ref List <ItemId> appointments)
        {
            FindAppointmentsDialog dialog = new FindAppointmentsDialog();

            dialog.CurrentService = service;

            dialog.txtStartTime.Text = DateTime.Now.ToString();
            dialog.txtEndTime.Text   = DateTime.Now.ToString();

            DialogResult res = ((Form)dialog).ShowDialog();

            if (res == DialogResult.OK)
            {
                AppointmentsContentForm.Show(
                    string.Format(
                        "CalendarView from {0} to {1} in {2}.",
                        dialog.txtStartTime.Text,
                        dialog.txtEndTime.Text,
                        dialog.CurrentCalendar),
                    dialog.AppointmentsFound,
                    dialog.CurrentService,
                    dialog.ParentForm);
            }

            return(res);
        }
Пример #2
0
        /// <summary>
        /// Display CalendarViewDialog to gather search criteria then
        /// open the ContentsForm and display search results.
        /// </summary>
        /// <param name="sender">The parameter is not used.</param>
        /// <param name="e">The parameter is not used.</param>
        private void MnuFindAppointments_Click(object sender, EventArgs e)
        {
            List <ItemId> appts = null;

            FindAppointmentsDialog.ShowDialog(this.CurrentService, ref appts);

            if (appts != null)
            {
                ItemsContentForm.Show("CalendarView results.", appts, this.CurrentService, this);
            }
        }