/// <summary> /// Allow the dialog to return a single result selection /// from the list of results from ResolveName /// </summary> /// <param name="service">ServiceBinding to use to make calls.</param> /// <param name="name">Selected name.</param> public static DialogResult ShowDialog(ExchangeService service, out NameResolution name) { if (service == null) { throw new ArgumentNullException("service", ExceptionHelper.ExchangeServiceRequiredMessage); } ResolveNameDialog diag = new ResolveNameDialog(); diag.CurrentService = service; DialogResult res = diag.ShowDialog(); if (res == DialogResult.OK && diag.lstNames.SelectedItems.Count == 1) { name = diag.lstNames.SelectedItems[0].Tag as NameResolution; } else { name = null; } return(res); }
private void ResolveNamesButton_Click(object sender, EventArgs e) { NameResolution name = null; if (ResolveNameDialog.ShowDialog(this.CurrentService, out name) == DialogResult.OK) { if (name.Mailbox != null) { this.SmtpAddressText.Text = name.Mailbox.Address; } } }
/// <summary> /// Display the ResolveNamesDialog to get a principal mailbox /// </summary> private void btnResolvePrin_Click(object sender, EventArgs e) { NameResolution principal = null; DialogResult res = ResolveNameDialog.ShowDialog(this.CurrentService, out principal); // If no name is returned or dialog result wasn't okay then bailout if (res != DialogResult.OK || principal == null) { return; } this.PrincipalMailbox = new Mailbox(principal.Mailbox.Address); }
private void ResolveNameButton_Click(object sender, EventArgs e) { NameResolution name = null; if (ResolveNameDialog.ShowDialog(this.CurrentService, out name) == DialogResult.OK) { if (name != null && name.Mailbox != null) { this.DisplayNameText.Text = name.Mailbox.Name; this.SmtpAddressText.Text = name.Mailbox.Address; this.standardUserCombo.SelectedItem = null; } } }
/// <summary> /// Show the ResolveNameDialog to get a Mailbox /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { NameResolution name = null; // Show the ResolveNamesDialog to pick a user if (ResolveNameDialog.ShowDialog(this.CurrentService, out name) == DialogResult.OK) { // Create a FolderPermission and add it to the ListView UserId user = new UserId(); user.DisplayName = name.Mailbox.Name; user.PrimarySmtpAddress = name.Mailbox.Address; FolderPermission permission = new FolderPermission(user, FolderPermissionLevel.None); AddFolderPermissionToList(permission); } }
public static DialogResult ShowDialog(ExchangeService service) { NameResolution name = null; return(ResolveNameDialog.ShowDialog(service, out name)); }
/// <summary> /// Display the ResolvNameDialog /// </summary> /// <param name="sender">The parameter is not used.</param> /// <param name="e">The parameter is not used.</param> private void MnuResolveName_Click(object sender, EventArgs e) { ResolveNameDialog.ShowDialog(this.CurrentService); }