public string CreateMeetingRequest(DateTime startDate, DateTime endDate, string subject, string summary, string location, string[] optionalAttendies, string[] attendeeList) { string meetingId = null; ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013); service.UseDefaultCredentials = true; service.AutodiscoverUrl(AutodiscoverURL, RedirectionUrlValidationCallback); Appointment appointment = new Appointment(service); TimeSpan difference = endDate - startDate; int hours = (int)difference.Hours; double minutus = (double)difference.Minutes; appointment.Subject = subject; appointment.Body = summary; appointment.StartTimeZone = TimeZoneInfo.Local; appointment.EndTimeZone = TimeZoneInfo.Local; appointment.Start = startDate; if (hours != 0) appointment.End = appointment.Start.AddHours(hours); else appointment.End = appointment.Start.AddMinutes(minutus); appointment.Resources.Add(location); DayOfTheWeek[] days = new DayOfTheWeek[] { DayOfTheWeek.Weekday }; appointment.Recurrence = new Recurrence.WeeklyPattern(appointment.Start.Date, 1, days); appointment.Recurrence.StartDate = appointment.Start.Date; appointment.Recurrence.NumberOfOccurrences = 5; appointment.Recurrence.EndDate = endDate; appointment.IsReminderSet = true; appointment.ReminderMinutesBeforeStart = 15; if (attendeeList != null) { if (attendeeList.Length > 0) { for (int i = 0; i < attendeeList.Length; i++) { appointment.RequiredAttendees.Add(attendeeList[i].ToString()); } } } if (optionalAttendies != null) { if (optionalAttendies.Length > 0) { for (int j = 0; j < optionalAttendies.Length; j++) { appointment.OptionalAttendees.Add(optionalAttendies[j].ToString()); } } } appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy); meetingId = appointment.Id.ToString(); return meetingId; }
Public string CreateMeetingRequest
return
Private
private
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)