private void LoadPropertiesForAll_OneCall() { if (lstChanges.Items.Count > 0) { this.Cursor = Cursors.WaitCursor; List <Item> oItemList = new List <Item>(); foreach (ListViewItem oLVI in lstChanges.Items) { ItemChange oItemChange = (ItemChange)oLVI.Tag; oItemList.Add(oItemChange.Item); // build a list of all items } StringBuilder oSB = new StringBuilder(); oSB.AppendFormat("\r\n"); oSB.AppendFormat("=================================================================================\r\n"); oSB.AppendFormat("[ All Change Events in on call + LoadPropertiesForItems]=========================\r\n"); oSB.AppendFormat(""); oSB.Append(GatherChanges(oItemList)); // now do once call to get props for all. string sContent = oSB.ToString(); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Properties for all items"; oForm.txtEntry.Text = sContent; oForm.ShowDialog(); this.Cursor = Cursors.Default; } }
public static void DisplaySelectedItemMIMEasText(ExchangeService oExchangeService, ListView oListView) { if (oListView.SelectedItems.Count > 0) { string sInfo = string.Empty; ItemTag oItemTag = (ItemTag)oListView.SelectedItems[0].Tag; GetItemMime(oExchangeService, oItemTag.Id, ref sInfo); ShowTextDocument oForm = new ShowTextDocument(); oForm.Text = "Item MIME"; oForm.txtEntry.Text = sInfo; oForm.ShowDialog(); oForm = null; } }
private void lstChanges_DoubleClick(object sender, EventArgs e) { if (lstChanges.SelectedItems.Count > 0) { ItemChange oItemChange = (ItemChange)lstChanges.SelectedItems[0].Tag; List <Item> oItemList = new List <Item>(); oItemList.Add(oItemChange.Item); StringBuilder oSB = new StringBuilder(); oSB.AppendFormat("\r\n"); oSB.AppendFormat("********************************************************************************************\r\n"); oSB.AppendFormat("[Change Event]******************************************************************************\r\n"); oSB.AppendFormat("ItemId: {0}\r\n", oItemChange.ItemId.ToString()); oSB.AppendFormat("ChangeType: {0}\r\n", oItemChange.ChangeType); oSB.AppendFormat("IsRead: {0}\r\n", oItemChange.IsRead); if (oItemChange.Item != null) { Item oItem = oItemChange.Item; oSB.AppendLine(""); oSB.AppendFormat("[Change Object's Item properties.]-------------------------\r\n"); if (oItem.Id == null) { oSB.AppendFormat("Problem with Item - its Id is null: {0}\r\n", oItem.Id.UniqueId); } else { oSB.AppendFormat("UniqueId: {0}\r\n", oItem.Id.UniqueId); } AddItemProps(oItem, ref oSB); } oSB.Append(GatherChanges(oItemList)); string sContent = oSB.ToString(); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Properties for item"; oForm.txtEntry.Text = sContent; oForm.ShowDialog(); } }
public static void DisplaySelectedItemProperties(ExchangeService oExchangeService, ListView oListView) { if (oListView.SelectedItems.Count > 0) { string sInfo = string.Empty; ItemTag oItemTag = (ItemTag)oListView.SelectedItems[0].Tag; GetItemInfo(oExchangeService, oItemTag.Id, oItemTag.ItemClass, ref sInfo); ShowTextDocument oForm = new ShowTextDocument(); oForm.Text = "Item Properties"; oForm.txtEntry.Text = sInfo; oForm.ShowDialog(); oForm = null; // _EwsCaller.ExchService. } }
private void LoadPropertiesForAll_SeperateCalls() { StringBuilder oSB = new StringBuilder(); if (lstChanges.Items.Count > 0) { this.Cursor = Cursors.WaitCursor; foreach (ListViewItem oLVI in lstChanges.Items) { ItemChange oItemChange = (ItemChange)oLVI.Tag; List <Item> oItemList = new List <Item>(); // next! oItemList.Add(oItemChange.Item); oSB.AppendFormat(""); oSB.AppendFormat("******************************************************************************************** *r\n"); oSB.AppendFormat("[Change Event]******************************************************************************\r\n"); oSB.AppendFormat("ItemId: {0}\r\n", oItemChange.ItemId.ToString()); oSB.AppendFormat("ChangeType: {0}\r\n", oItemChange.ChangeType); oSB.AppendFormat("IsRead: {0}\r\n", oItemChange.IsRead); oSB.Append(GatherChanges(oItemList)); // get props for this one changed item } string sContent = oSB.ToString(); // get results ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Properties for all items"; oForm.txtEntry.Text = sContent; oForm.ShowDialog(); this.Cursor = Cursors.Default; } }