/// <summary> /// Allow the user to input an ItemId and display its properites /// in FolderContentsForm. /// </summary> /// <param name="sender">The parameter is not used.</param> /// <param name="e">The parameter is not used.</param> private void MnuOpenItemById_Click(object sender, EventArgs e) { ItemId itemId = null; if (ItemIdDialog.ShowDialog(out itemId, this.CurrentService) == DialogResult.OK) { List <ItemId> item = new List <ItemId>(); item.Add(itemId); ItemsContentForm.Show( "Displaying item by ItemId", item, this.CurrentService, this); } }
public static DialogResult ShowDialog(out ItemId itemId, ExchangeService _CurrentService) { itemId = null; ItemIdDialog diag = new ItemIdDialog(); diag.Text = "Enter a Item's Id..."; DialogResult res = diag.ShowDialog(); if (res == DialogResult.OK) { if (diag.cmboIdType.Text == "UniqueId") { itemId = new ItemId(diag.txtUniqueId.Text); } if (diag.cmboIdType.Text == "StoreId") { string sUniqueId = string.Empty; AlternateId FromId = new AlternateId( IdFormat.StoreId, diag.txtUniqueId.Text.Trim(), diag.txtSmtpAddress.Text.Trim() ); //FromId.Format = IdFormat.StoreId; //FromId.Mailbox = diag.txtSmtpAddress.Text.Trim(); //FromId.UniqueId = diag.txtUniqueId.Text.Trim(); AlternateId ToId = (AlternateId)_CurrentService.ConvertId(FromId, IdFormat.EwsId); sUniqueId = ToId.UniqueId; itemId = new ItemId(diag.txtUniqueId.Text); } } return(res); }