Example #1
0
        /// <summary>
        /// Display the DelegateDialog for the current mailbox.
        /// </summary>
        /// <param name="sender">The parameter is not used.</param>
        /// <param name="e">The parameter is not used.</param>
        private void MnuDelegateInformation_Click(object sender, EventArgs e)
        {
            NameResolutionCollection names = null;

            // Attempt to resolve the Act As account name.  If there is only one
            // hit from ResolveNames then assume it is the right one.
            if (this.CurrentAppSettings != null)
            {
                if (this.CurrentAppSettings.AuthenticationMethod == RequestedAuthType.oAuth)
                {
                    names = this.CurrentService.ResolveName(this.CurrentAppSettings.MailboxBeingAccessed);
                }
                else
                {
                    names = this.CurrentService.ResolveName(this.CurrentService.GetActAsAccountName());
                }
            }
            else
            {
                names = this.CurrentService.ResolveName(this.CurrentService.GetActAsAccountName());
                //this.CurrentAppSettings.MailboxBeingAccessed;
            }

            if (names.Count == 1)
            {
                DialogResult res = DelegateDialog.ShowDialog(
                    this.CurrentService,
                    new Mailbox(names[0].Mailbox.Address));
            }
            else
            {
                DialogResult res = DelegateDialog.ShowDialog(this.CurrentService);
            }
        }
Example #2
0
        /// <summary>
        /// Show the form used to display and edit DelegateInformation on the
        /// given mailbox.
        /// </summary>
        /// <param name="binding">ServiceBinding to use to make calls.</param>
        /// <returns>DialogResult - DialogResult.OK means changes were committed.</returns>
        public static DialogResult ShowDialog(ExchangeService service, Mailbox delegator)
        {
            DelegateDialog dialog = new DelegateDialog();

            dialog.PrincipalMailbox = delegator;
            dialog.CurrentService   = service;

            return(dialog.ShowDialog());
        }