protected override void LoadContents() { // Add each Appointment to the ContentsGrid with no data binding foreach (Appointment appt in this.currentAppointments) { int row = this.ContentsGrid.Rows.Add(); this.ContentsGrid.Rows[row].Cells[ColNameStartTime].Value = appt.Start.ToString(); this.ContentsGrid.Rows[row].Cells[ColNameEndTime].Value = appt.End.ToString(); this.ContentsGrid.Rows[row].Cells[ColNameSubject].Value = appt.Subject; this.ContentsGrid.Rows[row].Cells[ColNameOrganizer].Value = PropertyInterpretation.GetPropertyValue(appt.Organizer); this.ContentsGrid.Rows[row].Cells[ColNameReqAttendees].Value = PropertyInterpretation.GetPropertyValue(appt.RequiredAttendees); this.ContentsGrid.Rows[row].Cells[ColNameOptAttendees].Value = PropertyInterpretation.GetPropertyValue(appt.OptionalAttendees); this.ContentsGrid.Rows[row].Cells[ColNameResources].Value = PropertyInterpretation.GetPropertyValue(appt.Resources); //this.ContentsGrid.Rows[row].Cells[ColNameItemId].Value = appt.Id.UniqueId; //this.ContentsGrid.Rows[row].Cells[ColPidLidClientIntent].Value = PropertyInterpretation.GetPropertyValue(appt.Resources); //this.ContentsGrid.Rows[row].Cells[ColClientInfoString].Value = PropertyInterpretation.GetPropertyValue(appt.Resources); //this.ContentsGrid.Rows[row].Cells[ColPidLidCleanGlobalObjectId].Value = PropertyInterpretation.GetPropertyValue(appt.Resources); } base.LoadContents(); }
private void DisplayAttendeeResults(AttendeeDataContainer attendeeData) { // Clear existing availability information this.AttendeeAvailabilityList.Items.Clear(); this.CalEventsList.Items.Clear(); // Display the given AttendeeAvailability in the ListView AttendeeAvailability availability = attendeeData.Availability; if (availability != null && availability.Result == ServiceResult.Success) { // Change the label text to indicate the selected attendee //this.AttendeeAvailabilityGroup.Text = string.Format(SelectedAttendeeLabelText, attendeeData.Info.SmtpAddress); ListViewItem availRow = this.AttendeeAvailabilityList.Items.Add(PropertyInterpretation.GetPropertyValue(availability.ViewType)); availRow.SubItems.Add(PropertyInterpretation.GetPropertyValue(availability.WorkingHours)); if (availability.MergedFreeBusyStatus.Count > 0) { availRow.SubItems.Add(PropertyInterpretation.GetPropertyValue(availability.MergedFreeBusyStatus)); } foreach (CalendarEvent calEvent in availability.CalendarEvents) { ListViewItem calRow = this.CalEventsList.Items.Add(PropertyInterpretation.GetPropertyValue(calEvent.FreeBusyStatus)); calRow.SubItems.Add(PropertyInterpretation.GetPropertyValue(calEvent.StartTime)); calRow.SubItems.Add(PropertyInterpretation.GetPropertyValue(calEvent.EndTime)); if (calEvent.Details != null) { calRow.SubItems.Add(calEvent.Details.Subject); calRow.SubItems.Add(calEvent.Details.Location); calRow.SubItems.Add(calEvent.Details.IsException.ToString()); calRow.SubItems.Add(calEvent.Details.IsMeeting.ToString()); calRow.SubItems.Add(calEvent.Details.IsPrivate.ToString()); calRow.SubItems.Add(calEvent.Details.IsRecurring.ToString()); calRow.SubItems.Add(calEvent.Details.IsReminderSet.ToString()); calRow.SubItems.Add(calEvent.Details.StoreId); } } } else if (availability != null && availability.Result == ServiceResult.Error) { ErrorDialog.ShowServiceResponseMsgBox( availability, String.Format("Availability request returned an error for attendee, {0}.", attendeeData.Info.SmtpAddress), string.Empty, MessageBoxIcon.Warning); } else if (availability != null) { throw new NotImplementedException( string.Format( "Unexpected ServiceResult, {0}, for AttendeeAvailability", availability.Result.ToString())); } }
/// <summary> /// Save the current profile and its items to the given file path. /// </summary> /// <param name="profilePath">File to save the profile information.</param> internal void SaveProfile(string profilePath) { ServicesProfile.ServiceBindingDataTable data = new ServicesProfile.ServiceBindingDataTable(); foreach (ServiceProfileItem item in this.profileItems) { ServicesProfile.ServiceBindingRow row = data.NewServiceBindingRow(); row.Name = PropertyInterpretation.GetPropertyValue(item.Service); //row.AutoDiscoverEmail = this.AutodiscoverEmailUsed; row.ServicesURL = item.Service.Url.OriginalString; row.RequestedServerVersion = item.Service.RequestedServerVersion.ToString(); if (item.Service.ImpersonatedUserId != null) { row.ImpersonationId = item.Service.ImpersonatedUserId.Id; row.ImpersonationType = item.Service.ImpersonatedUserId.IdType.ToString(); } row.UsesDefaultCredentials = item.Service.UseDefaultCredentials; //row.UserName = item.Service.GetNetworkCredential().UserName; //TODO: The saving and loading of profiles needs to be reworked. //row.Domain = item.Service.GetNetworkCredential().Domain; // Add root folders to the data table. StringBuilder sb = new StringBuilder(); foreach (FolderId id in item.RootFolderIds) { // If this is not the first FolderId add a separator if (sb.Length > 0) { sb.Append("|"); } if (id.FolderName.HasValue && id.Mailbox != null) { sb.Append(string.Format(System.Globalization.CultureInfo.CurrentCulture, "Name:{0},Mbx:{1}", id.FolderName.ToString(), id.Mailbox.Address)); } else if (id.FolderName.HasValue) { sb.Append(string.Format(System.Globalization.CultureInfo.CurrentCulture, "Name:{0}", id.FolderName.ToString())); } else { sb.Append(string.Format(System.Globalization.CultureInfo.CurrentCulture, "Id:{0}", id.UniqueId)); } } row.RootFolderIds = sb.ToString(); data.AddServiceBindingRow(row); } data.WriteXml(profilePath); }
private void btnFolderId_Click(object sender, EventArgs e) { FolderIdDialog oForm = new FolderIdDialog(_CurrentService); oForm.ShowDialog(); if (oForm.ChoseOK == true) { lblFolderId.Text = PropertyInterpretation.GetPropertyValue(oForm.ChosenFolderId); } //if (FolderIdDialog.ShowDialog(ref this._SelectedFolder) == DialogResult.OK) //{ // lblFolderId.Text = PropertyInterpretation.GetPropertyValue(this._SelectedFolder); //} }