Exemplo n.º 1
0
        private void ClearAvailabilityResults()
        {
            // Clear results from all attendees in the AttendeeList
            foreach (ListViewItem item in this.AttendeeList.Items)
            {
                AttendeeDataContainer?attendeeData = item.Tag as AttendeeDataContainer?;
                if (attendeeData.HasValue)
                {
                    AttendeeDataContainer data = attendeeData.Value;
                    data.Availability = null;
                    item.Tag          = data;
                }
            }

            // Clear all result lists
            this.AttendeeAvailabilityList.Items.Clear();
            this.CalEventsList.Items.Clear();
            this.SuggestionsList.Items.Clear();

            this.AttendeeAvailabilityList.Enabled = false;
            this.CalEventsList.Enabled            = false;
            this.SuggestionsList.Enabled          = false;

            // Indicate that there are availability results yet
            //this.AttendeeAvailabilityGroup.Text = String.Concat("Click the '", this.GetAvailabilityButton.Text, "' button to get availablity results.");
        }
Exemplo n.º 2
0
        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()));
            }
        }
Exemplo n.º 3
0
        private void AddResultsToAttendee(AttendeeInfo attendee, AttendeeAvailability availability)
        {
            // Find the given attendee in the AttendeeList and add the
            // passed AttendeeAvailability and Suggestion so they can be
            // displayed when the attendee is selected.
            foreach (ListViewItem item in this.AttendeeList.Items)
            {
                AttendeeDataContainer?attendeeData = item.Tag as AttendeeDataContainer?;
                if (attendeeData.HasValue)
                {
                    // Match the attendees by SMTP address
                    AttendeeDataContainer data = attendeeData.Value;
                    if (String.Equals(attendee.SmtpAddress, data.Info.SmtpAddress, StringComparison.CurrentCultureIgnoreCase))
                    {
                        // If we found the attendee then set the values and break out
                        data.Availability = availability;
                        item.Tag          = data;
                        return;
                    }
                }
            }

            DebugLog.WriteVerbose(string.Format("Leave: Attendee, {0}, not found in AttendeeList", attendee.SmtpAddress));
        }