public MeetingInfo() { Meeting = new DatabaseManager.Data.Meeting(); Names = new List <string>(); HostInfo = new WebexHostInfo(); AttendeesEmails = new List <SendGrid.Helpers.Mail.EmailAddress>(); Meeting.MeetingStartDateTime = new DateTime(); Meeting.MeetingEndDateTime = new DateTime(); }
public MeetingInfo(DatabaseManager.Data.Meeting meeting, List <EmailAddress> attendeesEmails, string password = "", WebexHostInfo hostInfo = null) { Meeting = meeting; AttendeesEmails = attendeesEmails; HostInfo = hostInfo; Names = GetNames(); }
public static Meeting.MeetingInfo GetMeetingInfoFromOutlookInvite(Message message) { var body = message.Body.Content; string subject = ""; var participants = new List <SendGrid.Helpers.Mail.EmailAddress>(); DateTime startTime = new DateTime(); DateTime endTime = new DateTime(); /*Get the meeting subject and remove the property name for next property from this string*/ var subjectRegex = new Regex("Subject:.+Participants:"); subject = subjectRegex.Match(body).Value.Replace("Participants:", ""); /*Get the list of participant emails as a string and remove the property name of next property */ var emailsRegex = new Regex("Participants:.+Start Date Time:"); var emailsString = emailsRegex.Match(body).Value; emailsString = emailsString.Replace("Participants:", "").Replace("Start Date Time:", ""); /*Convert email string to a list of SendGrid.Helpers.Mail.EmailAddress object */ participants = ParseOutlookEmailsString(emailsString); /*Attempt to get start time */ var startTimeRegex = new Regex("Start Date Time:+.End Date Time:"); var startTimeStr = startTimeRegex.Match(body).Value; startTimeStr = startTimeStr.Replace("Start Date Time:", "").Replace("End Date Time:", ""); Boolean startTimeParsed = DateTime.TryParse(startTimeStr, out startTime); /*Attempt to get end time */ var endTimeRegex = new Regex("End Date Time:.+"); var endTimeStr = endTimeRegex.Match(body).Value.Replace("End Date Time:", ""); Boolean endTimeParsed = DateTime.TryParse(endTimeStr, out startTime); var meeting = new DatabaseManager.Data.Meeting(0, subject, "", startTime, endTime); return(new Meeting.MeetingInfo(meeting, participants)); }