private void lvUserRetentionTags_DoubleClick(object sender, EventArgs e) { if (lvUserRetentionTags.SelectedItems.Count > 0) { ListViewItem o = lvUserRetentionTags.SelectedItems[0]; StringBuilder oSB = new StringBuilder(); oSB.AppendFormat("{0}: {1}\r\n", "DisplayName: ", o.SubItems[0].Text); oSB.AppendFormat("{0}: {1}\r\n", "Description: ", o.SubItems[1].Text); oSB.AppendFormat("{0}: {1}\r\n", "Type: ", o.SubItems[2].Text); oSB.AppendFormat("{0}: {1}\r\n", "OptedInto: ", o.SubItems[3].Text); oSB.AppendFormat("{0}: {1}\r\n", "RetentionAction: ", o.SubItems[4].Text); oSB.AppendFormat("{0}: {1}\r\n", "RetentionId: ", o.SubItems[5].Text); oSB.AppendFormat("{0}: {1}\r\n", "RetentionPeriod: ", o.SubItems[6].Text); oSB.AppendFormat("{0}: {1}\r\n", "IsArchive: ", o.SubItems[7].Text); oSB.AppendFormat("{0}: {1}\r\n", "IsVisible: ", o.SubItems[8].Text); ShowTextDocument oForm = new ShowTextDocument(); oForm.Text = "User Retention Tag"; oForm.txtEntry.Text = oSB.ToString(); oForm.ShowDialog(); oForm = null; } }
private void btnSummaryListAsText_Click(object sender, EventArgs e) { ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.Text = GetTimezoneList(); oForm.Text = "Timezone list as text"; oForm.Show(); }
private void btnAttendeeStatus_Click(object sender, EventArgs e) { string s = AppointmentHelper.GetAttendeeStatusAsInfoString(_Appointment); ShowTextDocument oForm = new ShowTextDocument(); oForm.Text = "Attendee Status"; oForm.txtEntry.Text = s; oForm.ShowDialog(); oForm = null; }
private void serverTimeZoneToolStripMenuItem_Click(object sender, EventArgs e) { DateTime oDateTime = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Unspecified); StringBuilder oSB = new StringBuilder(); oSB.AppendLine("Server TimeZoneInfo:"); oSB.AppendLine(TimeHelper.GetValuesFromTimeZoneInfo(CurrentService.TimeZone)); oSB.AppendLine(""); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Server TimeZone"; oForm.txtEntry.Text = oSB.ToString(); oForm.Show(); }
private void DisplayFolderInfo() { if (lvItems.SelectedItems.Count > 0) { StringBuilder oSB = new StringBuilder(); oSB.AppendFormat("DisplayName: {0}\r\n", lvItems.SelectedItems[0].SubItems[1].Text); oSB.AppendFormat("FolderClass: {0}\r\n", lvItems.SelectedItems[0].SubItems[2].Text); oSB.AppendFormat("Folder Path: {0}\r\n", lvItems.SelectedItems[0].SubItems[6].Text); oSB.AppendFormat("UniqueId: {0}\r\n", lvItems.SelectedItems[0].SubItems[7].Text); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Folder"; oForm.txtEntry.Text = oSB.ToString(); oForm.Show(); } }
private void cmsItemsAttendeeStatus_Click(object sender, EventArgs e) { if (lvItems.SelectedItems.Count > 0) { string sInfo = string.Empty; ItemTag oItemTag = (ItemTag)this.lvItems.SelectedItems[0].Tag; oItemTag = (ItemTag)lvItems.SelectedItems[0].Tag; _CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID Appointment oAppointment = Appointment.Bind(_CurrentService, oItemTag.Id); string s = AppointmentHelper.GetAttendeeStatusAsInfoString(oAppointment); ShowTextDocument oForm = new ShowTextDocument(); oForm.Text = "Attendee Status"; oForm.txtEntry.Text = s; oForm.ShowDialog(); oForm = null; } }
private void lvItems_DoubleClick(object sender, EventArgs e) { string sDisplay = string.Empty; if (lvItems.SelectedItems.Count > 0) { sDisplay += "Type: \r\n"; sDisplay += "-----\r\n" + lvItems.SelectedItems[0].Text; sDisplay += "\r\n\r\n"; sDisplay += "Value(s): \r\n"; sDisplay += "---------\r\n" + lvItems.SelectedItems[0].SubItems[1].Text; ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Values for item"; oForm.txtEntry.Text = sDisplay; oForm.ShowDialog(); } }
private void btnHeaders_Click(object sender, EventArgs e) { string sInfo = string.Empty; if (_EmailMessage != null) { if (_IsExistingEmail == true) { if (_EmailMessage.IsDraft == false) { foreach (InternetMessageHeader oHeader in _EmailMessage.InternetMessageHeaders) { sInfo += oHeader.Name + ": " + oHeader.Value + "\r\n"; } ShowTextDocument oForm = new ShowTextDocument(); oForm.Text = "Message Headers"; oForm.txtEntry.Text = sInfo; oForm.ShowDialog(); oForm = null; //ExtendedPropertyDefinition PidTagMimeSkeleton = new ExtendedPropertyDefinition(0x64F00102, MapiPropertyType.String); // http://msdn.microsoft.com/en-us/library/office/hh545614(v=exchg.140).aspx } else { MessageBox.Show("Message needs to have been sent to have transport headers. If you want to set one prior to transport then a custom x-header is needed - this is done by setting an exteded property.", "No headers."); } } else { MessageBox.Show("Message needs to have been sent to have transport headers. If you want to set one prior to transport then a custom x-header is needed - this is done by setting an exteded property.", "No headers."); } } else { MessageBox.Show("No headers.", "No headers."); } }
private void mnuWindowsUserInformation_Click(object sender, EventArgs e) { string sInfo = string.Empty; StringBuilder oSB = new StringBuilder(); oSB.AppendFormat("From UserPrincipal: \r\n"); oSB.AppendFormat(" DisplayName: {0}\r\n", UserPrincipal.Current.DisplayName); oSB.AppendFormat(" GivenName: {0}\r\n", UserPrincipal.Current.GivenName); oSB.AppendFormat(" DistinguishedName: {0}\r\n", UserPrincipal.Current.DistinguishedName); oSB.AppendFormat(" Name: {0}\r\n", UserPrincipal.Current.Name); if (UserPrincipal.Current.MiddleName != null) { oSB.AppendFormat(" MiddleName: {0}\r\n", UserPrincipal.Current.MiddleName); } oSB.AppendFormat("\r\n"); if (UserPrincipal.Current.EmailAddress != null) { oSB.AppendFormat(" EmailAddress: {0}\r\n", UserPrincipal.Current.EmailAddress); } if (UserPrincipal.Current.SamAccountName != null) { oSB.AppendFormat(" SamAccountName: {0}\r\n", UserPrincipal.Current.SamAccountName); } if (UserPrincipal.Current.Sid != null) { oSB.AppendFormat(" Sid: {0}\r\n", UserPrincipal.Current.Sid.Value); } if (UserPrincipal.Current.UserPrincipalName != null) { oSB.AppendFormat(" UserPrincipalName: {0}\r\n", UserPrincipal.Current.UserPrincipalName); } if (UserPrincipal.Current.Surname != null) { oSB.AppendFormat(" Surname: {0}\r\n", UserPrincipal.Current.Surname); } if (UserPrincipal.Current.VoiceTelephoneNumber != null) { oSB.AppendFormat(" VoiceTelephoneNumber: {0}\r\n", UserPrincipal.Current.VoiceTelephoneNumber); } if (UserPrincipal.Current.HomeDirectory != null) { oSB.AppendFormat(" HomeDirectory: {0}\r\n", UserPrincipal.Current.HomeDirectory); } if (UserPrincipal.Current.Guid != null) { oSB.AppendFormat(" Guid: {0}\r\n", UserPrincipal.Current.Guid.ToString()); } if (UserPrincipal.Current.Description != null) { oSB.AppendFormat(" Description: {0}\r\n", UserPrincipal.Current.Description.ToString()); } oSB.AppendFormat("\r\n"); oSB.AppendFormat(" PasswordNeverExpires: {0}\r\n", UserPrincipal.Current.PasswordNeverExpires.ToString()); oSB.AppendFormat(" PasswordNotRequired: {0}\r\n", UserPrincipal.Current.PasswordNotRequired.ToString()); oSB.AppendFormat(" UserCannotChangePassword: {0}\r\n", UserPrincipal.Current.UserCannotChangePassword.ToString()); oSB.AppendFormat(" SmartcardLogonRequired: {0}\r\n", UserPrincipal.Current.SmartcardLogonRequired.ToString()); oSB.AppendFormat("\r\n"); if (UserPrincipal.Current.AccountExpirationDate.HasValue) { oSB.AppendFormat(" AccountExpirationDate: {0}\r\n", UserPrincipal.Current.AccountExpirationDate.ToString()); } if (UserPrincipal.Current.AccountLockoutTime.HasValue) { oSB.AppendFormat(" AccountLockoutTime: {0}\r\n", UserPrincipal.Current.AccountLockoutTime.ToString()); } //string sUserName = UserPrincipal.Current.SamAccountName; //DirectorySearcher oDirectorySearcher = new DirectorySearcher(); //oDirectorySearcher.Filter = String.Format("(SAMAccountName={0})", sUserName); //oDirectorySearcher.PropertiesToLoad.Add("cn"); //oDirectorySearcher.PropertiesToLoad.Add("samaccountname"); //oDirectorySearcher.PropertiesToLoad.Add("givenname"); //oDirectorySearcher.PropertiesToLoad.Add("displayname"); //oDirectorySearcher.PropertiesToLoad.Add("mail"); //oDirectorySearcher.PropertiesToLoad.Add("userPrincipalName"); //oDirectorySearcher.PropertiesToLoad.Add("distinguishedName"); //SearchResult oSearchResult = oDirectorySearcher.FindOne(); //oSB.AppendFormat("From AD Search on SAMAccountName: \r\n"); //if (oSearchResult!= null) //{ // oSearchResult.Properties["displayname"][0].ToString(); //} //else //{ // oSB.AppendFormat("AD Search on SAMAccountName failed to return results. \r\n"); //} // Machine Information: try { oSB.AppendFormat("\r\n"); string sHostMachineName = Dns.GetHostName(); IPHostEntry hostInfo = Dns.GetHostEntry(sHostMachineName); IPAddress[] address = hostInfo.AddressList; String[] alias = hostInfo.Aliases; oSB.AppendFormat("Machine Name: {0}\r\n", sHostMachineName); oSB.AppendFormat("Aliases :\r\n"); for (int index = 0; index < alias.Length; index++) { oSB.AppendFormat(" {0}\r\n", alias[index]); } oSB.AppendFormat("IP address list : \r\n"); for (int index = 0; index < address.Length; index++) { oSB.AppendFormat(" {0}\r\n", address[index]); } } catch (Exception ex) { oSB.AppendFormat("\r\n"); oSB.AppendFormat("Error trying to retrieve Host information for this machine:\r\n"); oSB.AppendFormat("{0}\r\n", ex.Source); oSB.AppendFormat("{0}\r\n", ex.Message); } oSB.AppendLine(""); oSB.AppendLine(MachineInfo()); oSB.AppendLine(""); oSB.AppendLine(ProcessInfo()); oSB.AppendLine(""); oSB.AppendLine(GetDotNetInfo()); //oSB.AppendLine(""); //oSB.AppendLine(GetComputerTimeValues()); string sContent = oSB.ToString(); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Run-time Information"; oForm.txtEntry.Text = sContent; oForm.Show(); }
private void lstEvents_DoubleClick(object sender, EventArgs e) { string ParentFolderName = string.Empty; string ParentFolderClass = string.Empty; string OldParentFolderName = string.Empty; string OldParentFolderClass = string.Empty; string ItemName = string.Empty; string ItemClass = string.Empty; string OldItemName = string.Empty; string OldItemClass = string.Empty; string FolderEvent_FolderName = string.Empty; string FolderEvent_FolderClass = string.Empty; string Folder_OldFolderName = string.Empty; string Folder_OldFolderClass = string.Empty; Folder oFolderId = null; Item oItem = null; ExchangeService oExchangeService = null; if (lstEvents.SelectedItems.Count > 0) { if (lstEvents.SelectedItems[0].Tag.ToString().StartsWith("[") == false) { NotificationEvent evt = (NotificationEvent)lstEvents.SelectedItems[0].Tag; ItemEvent itemevt = (evt is ItemEvent) ? (ItemEvent)evt : null; FolderEvent folderevt = (evt is FolderEvent) ? (FolderEvent)evt : null; // New service and app settings EWSEditor.Common.EwsEditorAppSettings oCurrentAppSettings = new EWSEditor.Common.EwsEditorAppSettings(); oExchangeService = EwsProxyFactory.CreateExchangeService(); // Todo: Flush out oCurrentAppSettings CurrentAppSettings = oCurrentAppSettings; if (lstEvents.SelectedItems[0].SubItems[4].Text.TrimEnd().Length != 0) { try { oExchangeService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolderId = Folder.Bind(oExchangeService, new FolderId(evt.ParentFolderId.UniqueId)); if (oFolderId != null) { ParentFolderName = oFolderId.DisplayName; ParentFolderClass = oFolderId.FolderClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (lstEvents.SelectedItems[0].SubItems[5].Text.TrimEnd().Length != 0) { try { oExchangeService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolderId = Folder.Bind(oExchangeService, new FolderId(evt.OldParentFolderId.UniqueId)); if (oFolderId != null) { OldParentFolderName = oFolderId.DisplayName; OldParentFolderClass = oFolderId.FolderClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (lstEvents.SelectedItems[0].SubItems[6].Text.TrimEnd().Length != 0) { try { oExchangeService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oItem = Item.Bind(oExchangeService, new ItemId(itemevt.ItemId.UniqueId)); if (oItem != null) { ItemName = oItem.Subject; ItemClass = oItem.ItemClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (lstEvents.SelectedItems[0].SubItems[7].Text.TrimEnd().Length != 0) { try { oExchangeService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oItem = Item.Bind(oExchangeService, new ItemId(itemevt.OldItemId.UniqueId)); if (oItem != null) { OldItemName = oItem.Subject; OldItemClass = oItem.ItemClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (lstEvents.SelectedItems[0].SubItems[8].Text.TrimEnd().Length != 0) { try { oExchangeService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolderId = Folder.Bind(oExchangeService, new FolderId(folderevt.ParentFolderId.UniqueId)); if (oFolderId != null) { FolderEvent_FolderName = oFolderId.DisplayName; FolderEvent_FolderClass = oFolderId.FolderClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (lstEvents.SelectedItems[0].SubItems[9].Text.TrimEnd().Length != 0) { try { oExchangeService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolderId = Folder.Bind(oExchangeService, new FolderId(folderevt.OldParentFolderId.UniqueId)); if (oFolderId != null) { Folder_OldFolderName = oFolderId.DisplayName; Folder_OldFolderClass = oFolderId.FolderClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } StringBuilder oSB = new StringBuilder(); oSB.AppendFormat("EventType: \r\n {0}\r\n", lstEvents.SelectedItems[0].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("Thread: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[1].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("TimeStamp: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[2].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("EventType: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[3].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("ParentFolderId:\r\n"); if (evt != null) { if (evt.ParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", evt.ParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", evt.ParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", ParentFolderName); oSB.AppendFormat(" Class: {0}\r\n", ParentFolderClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("OldParentFolderId:\r\n"); if (evt != null) { if (evt.OldParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", evt.OldParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", evt.OldParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", OldParentFolderName); oSB.AppendFormat(" Class: {0}\r\n", OldParentFolderClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("Item.ItemId:\r\n"); if (itemevt != null) { if (itemevt.ItemId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", itemevt.ItemId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", itemevt.ItemId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", ItemName); oSB.AppendFormat(" Class: {0}\r\n", ItemClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("Item.OldItemId:\r\n"); if (itemevt != null) { if (itemevt.OldItemId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", itemevt.OldItemId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", itemevt.OldItemId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", OldItemName); oSB.AppendFormat(" Class: {0}\r\n", OldItemClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("FolderEvent.FolderId:\r\n"); if (folderevt != null) { if (folderevt.ParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", folderevt.ParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", folderevt.ParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", FolderEvent_FolderName); oSB.AppendFormat(" Class: {0}\r\n", FolderEvent_FolderClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("Folder.OldFolderId:\r\n"); if (folderevt != null) { if (folderevt.OldParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", folderevt.OldParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", folderevt.OldParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", Folder_OldFolderName); oSB.AppendFormat(" Class: {0}\r\n", Folder_OldFolderClass); } } oSB.AppendFormat("\r\n"); //oSB.AppendFormat("ParentFolderId: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[4].Text.TrimEnd().Replace("ChangeKey:", "\r\n ChangeKey:")); //oSB.AppendFormat("\r\n"); //oSB.AppendFormat("OldParentFolderId: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[5].Text.TrimEnd().Replace("ChangeKey:", "\r\n ChangeKey:")); //oSB.AppendFormat("\r\n"); //oSB.AppendFormat("Item.ItemId: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[6].Text.TrimEnd().Replace("ChangeKey:", " ChangeKey:")); //oSB.AppendFormat("\r\n"); //oSB.AppendFormat("Item.OldItemId: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[7].Text.TrimEnd().Replace("ChangeKey:", " ChangeKey:")); //oSB.AppendFormat("\r\n"); //oSB.AppendFormat("FolderEvent.FolderId: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[8].Text.TrimEnd().Replace("ChangeKey:", "\r\n ChangeKey:")); //oSB.AppendFormat("\r\n"); //oSB.AppendFormat("Folder.OldFolderId: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[9].Text.TrimEnd().Replace("ChangeKey:", " ChangeKey:")); //oSB.AppendFormat("\r\n"); oSB.AppendFormat("FolderEvent.UnreadCount: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[10].Text); string sContent = oSB.ToString(); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Information"; oForm.txtEntry.Text = sContent; oForm.ShowDialog(); } } }
private void lstEvents_DoubleClick(object sender, EventArgs e) { string ParentFolderName = string.Empty; string ParentFolderClass = string.Empty; string OldParentFolderName = string.Empty; string OldParentFolderClass = string.Empty; string ItemName = string.Empty; string ItemClass = string.Empty; string OldItemName = string.Empty; string OldItemClass = string.Empty; string FolderName = string.Empty; string FolderClass = string.Empty; string OldFolderName = string.Empty; string OldFolderClass = string.Empty; Folder oFolder = null; //Item oItem = null; StringBuilder oSB = new StringBuilder(); if (lstEvents.SelectedItems.Count > 0) { ListViewItem oListViewItem = lstEvents.SelectedItems[0]; if (oListViewItem.Tag.ToString().StartsWith("[") == false) { if (lstEvents.SelectedItems[0].Text == "ItemEvent") { ItemEvent oItemEvent = null; oItemEvent = (ItemEvent)oListViewItem.Tag; Item oSomeItem = null; if (oListViewItem.SubItems[3].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oSomeItem = Item.Bind(CurrentService, new ItemId(oItemEvent.ItemId.UniqueId)); if (oSomeItem != null) { ItemName = oSomeItem.Subject; ItemClass = oSomeItem.ItemClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (oListViewItem.SubItems[4].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oSomeItem = Item.Bind(CurrentService, new ItemId(oItemEvent.OldItemId.UniqueId)); if (oSomeItem != null) { OldItemName = oSomeItem.Subject; OldItemClass = oSomeItem.ItemClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (oListViewItem.SubItems[5].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolder = Folder.Bind(CurrentService, new FolderId(oItemEvent.ParentFolderId.UniqueId)); if (oFolder != null) { ParentFolderName = oFolder.DisplayName; ParentFolderClass = oFolder.FolderClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } if (oListViewItem.SubItems[6].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolder = Folder.Bind(CurrentService, new FolderId(oItemEvent.OldParentFolderId.UniqueId)); if (oFolder != null) { OldParentFolderName = oFolder.DisplayName; OldParentFolderClass = oFolder.FolderClass; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.ToString()); } } oSB.AppendFormat("EventType: \r\n {0}\r\n", lstEvents.SelectedItems[0].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("TimeStamp: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[1].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("ObjectType: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[2].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("Object:\r\n"); if (oItemEvent != null) { if (oItemEvent.ItemId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oItemEvent.ItemId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oItemEvent.ItemId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", ItemName); oSB.AppendFormat(" Class: {0}\r\n", ItemClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("OldObject:\r\n"); if (oItemEvent != null) { if (oItemEvent.OldItemId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oItemEvent.OldItemId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oItemEvent.OldItemId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", OldItemName); oSB.AppendFormat(" Class: {0}\r\n", OldItemClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("ParentFolder:\r\n"); if (oItemEvent != null) { if (oItemEvent.ParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oItemEvent.ParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oItemEvent.ParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", ParentFolderName); oSB.AppendFormat(" Class: {0}\r\n", ParentFolderClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("OldParentFolder:\r\n"); if (oItemEvent != null) { if (oItemEvent.OldParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oItemEvent.OldParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oItemEvent.OldParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", OldParentFolderName); oSB.AppendFormat(" Class: {0}\r\n", OldParentFolderClass); } } oSB.AppendFormat("\r\n"); } if (lstEvents.SelectedItems[0].Text == "FolderEvent") { FolderEvent oFolderEvent = null; oFolderEvent = (FolderEvent)oListViewItem.Tag; Item oSomeItem = null; if (oListViewItem.SubItems[3].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolder = Folder.Bind(CurrentService, new FolderId(oFolderEvent.FolderId.UniqueId)); if (oFolder != null) { FolderName = oSomeItem.Subject; FolderClass = oSomeItem.ItemClass; } } catch (Exception ex) { System.Console.WriteLine(ex.Message); } } if (oListViewItem.SubItems[4].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolder = Folder.Bind(CurrentService, new FolderId(oFolderEvent.OldFolderId.UniqueId)); if (oFolder != null) { OldFolderName = oSomeItem.Subject; OldFolderClass = oSomeItem.ItemClass; } } catch (Exception ex) { System.Console.WriteLine(ex.Message); } } if (oListViewItem.SubItems[5].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolder = Folder.Bind(CurrentService, new FolderId(oFolderEvent.ParentFolderId.UniqueId)); if (oFolder != null) { ParentFolderName = oFolder.DisplayName; ParentFolderClass = oFolder.FolderClass; } } catch (Exception ex) { System.Console.WriteLine(ex.Message); } } if (oListViewItem.SubItems[6].Text.TrimEnd().Length != 0) { try { CurrentService.ClientRequestId = Guid.NewGuid().ToString(); // Set a new GUID oFolder = Folder.Bind(CurrentService, new FolderId(oFolderEvent.OldParentFolderId.UniqueId)); if (oFolder != null) { OldParentFolderName = oFolder.DisplayName; OldParentFolderClass = oFolder.FolderClass; } } catch (Exception ex) { System.Console.WriteLine(ex.Message); } } oSB.AppendFormat("EventType: \r\n {0}\r\n", lstEvents.SelectedItems[0].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("TimeStamp: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[1].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("ObjectType: \r\n {0}\r\n", lstEvents.SelectedItems[0].SubItems[2].Text); oSB.AppendFormat("\r\n"); oSB.AppendFormat("Item:\r\n"); if (oFolderEvent != null) { if (oFolderEvent.FolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oFolderEvent.FolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oFolderEvent.FolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", ItemName); oSB.AppendFormat(" Class: {0}\r\n", ItemClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("OldItem:\r\n"); if (oFolderEvent != null) { if (oFolderEvent.OldFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oFolderEvent.OldFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oFolderEvent.OldFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", OldItemName); oSB.AppendFormat(" Class: {0}\r\n", OldItemClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("ParentFolder:\r\n"); if (oFolderEvent != null) { if (oFolderEvent.ParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oFolderEvent.ParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oFolderEvent.ParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", ParentFolderName); oSB.AppendFormat(" Class: {0}\r\n", ParentFolderClass); } } oSB.AppendFormat("\r\n"); oSB.AppendFormat("OldParentFolder:\r\n"); if (oFolderEvent != null) { if (oFolderEvent.OldParentFolderId != null) { oSB.AppendFormat(" UniqueId: {0}\r\n", oFolderEvent.OldParentFolderId.UniqueId.ToString()); oSB.AppendFormat(" ChangeKey: {0}\r\n", oFolderEvent.OldParentFolderId.ChangeKey.ToString()); oSB.AppendFormat(" Name: {0}\r\n", OldParentFolderName); oSB.AppendFormat(" Class: {0}\r\n", OldParentFolderClass); } } oSB.AppendFormat("\r\n"); } string sContent = oSB.ToString(); ShowTextDocument oForm = new ShowTextDocument(); oForm.txtEntry.WordWrap = false; oForm.Text = "Information"; oForm.txtEntry.Text = sContent; oForm.ShowDialog(); } } }