示例#1
0
        private void AddAttendeeButton_Click(object sender, EventArgs e)
        {
            AttendeeInfo info = null;

            if (AttendeeInfoDialog.ShowDialog(this.CurrentService, out info) == DialogResult.OK)
            {
                this.AddAttendeeToList(info);
            }
        }
示例#2
0
        /// <summary>
        /// Show a dialog to allow the user to input settings to
        /// create an AttendeeInfo object.
        /// </summary>
        /// <param name="attendee">
        /// Out parameter representing the AttendeeInfo created
        /// from the dialog settings.
        /// </param>
        /// <returns>
        /// Returns DialogResult.OK if the user clicked OK and the
        /// AttendeeInfo was created successfully.
        /// </returns>
        public static DialogResult ShowDialog(ExchangeService service, out AttendeeInfo attendee)
        {
            AttendeeInfo newAttendee = null;
            DialogResult result      = AttendeeInfoDialog.ShowDialog(service, null, null, out newAttendee);

            if (result == DialogResult.OK &&
                newAttendee != null)
            {
                attendee = newAttendee;
            }
            else
            {
                attendee = null;
            }

            return(result);
        }
示例#3
0
        /// <summary>
        /// Show a dialog to allow the user to input settings to
        /// create an AttendeeInfo object from the given information.
        /// </summary>
        /// <param name="address">Default address to preload in the form</param>
        /// <param name="attendeeType">Default MeetingAttendeeType to preload in the form</param>
        /// <param name="attendee">Output parameter representing the AttendeeInfo created
        /// from the dialog settings.</param>
        /// <returns>
        /// Returns DialogResult.OK if the user clicked OK and the
        /// AttendeeInfo was created successfully.
        /// </returns>
        public static DialogResult ShowDialog(
            ExchangeService service,
            EmailAddress address,
            MeetingAttendeeType attendeeType,
            out AttendeeInfo attendee)
        {
            AttendeeInfo newAttendee = null;
            DialogResult result      = AttendeeInfoDialog.ShowDialog(service, address, attendeeType, out newAttendee);

            if (result == DialogResult.OK &&
                newAttendee != null)
            {
                attendee = newAttendee;
            }
            else
            {
                attendee = null;
            }

            return(result);
        }
示例#4
0
        private static DialogResult ShowDialog(
            ExchangeService service,
            EmailAddress address,
            MeetingAttendeeType?attendeeType,
            out AttendeeInfo attendee)
        {
            if (service == null)
            {
                throw new ArgumentNullException("service", ExceptionHelper.ExchangeServiceRequiredMessage);
            }
            AttendeeInfoDialog dialog = new AttendeeInfoDialog();

            dialog.CurrentService = service;

            if (attendeeType.HasValue)
            {
                dialog.defaultAttendeeType = attendeeType.Value;
            }

            if (address != null)
            {
                dialog.defaultAddress = address;
            }

            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK &&
                dialog.currentAttendee != null)
            {
                attendee = dialog.currentAttendee;
            }
            else
            {
                attendee = null;
            }

            return(result);
        }