private void TimeSlotSelected(MeetingTimeCandidate meetingTimeCandidate)
 {
     if (meetingTimeCandidate != null)
     {
         var slot = TimeSlot.Parse(meetingTimeCandidate);
         SetTimeSlot(slot);
     }
 }
 public static TimeSlot Parse(MeetingTimeCandidate mtc)
 {
     return(new TimeSlot
     {
         Start = ParseTimeSlot(mtc.MeetingTimeSlot.Start),
         End = ParseTimeSlot(mtc.MeetingTimeSlot.End),
     });
 }
Exemple #3
0
        public async Task <object> GetMeetingTimes(string token, string userEmail, string payload)
        {
            string findMeetingTimesEndpoint = this.apiEndpoint + "/Me/FindMeetingTimes";

            //var jsonPayload = await Task.Run(() => JsonConvert.SerializeObject(payload));

            var result = await MakeGraphApiCall("POST", token, findMeetingTimesEndpoint, userEmail, payload, null);

            var response = await result.Content.ReadAsStringAsync();

            JObject responseJson = JObject.Parse(response);
            JArray  eventJson    = (JArray)responseJson["value"];

            List <MeetingTimeCandidate> meetingTimes = new List <MeetingTimeCandidate>();

            foreach (var e in eventJson)
            {
                MeetingTimeCandidate nextItem = new MeetingTimeCandidate();

                //add all the values
                nextItem.StartDate  = DateTime.Parse((string)e["MeetingTimeSlot"]["Start"]["Date"]);
                nextItem.StartTime  = DateTime.Parse((string)e["MeetingTimeSlot"]["Start"]["Time"]);
                nextItem.EndDate    = DateTime.Parse((string)e["MeetingTimeSlot"]["End"]["Date"]);
                nextItem.EndTime    = DateTime.Parse((string)e["MeetingTimeSlot"]["End"]["Time"]);
                nextItem.Confidence = int.Parse((string)e["Confidence"]);
                nextItem.Score      = int.Parse((string)e["Score"]);
                if (e["MeetingTimeSlot"]["Location"] != null)
                {
                    nextItem.LocationDisplayName = (string)e["MeetingTimeSlot"]["Location"]["Time"];
                    nextItem.LocationAddress     = BuildAddressString(e["MeetingTimeSlot"]["Location"]["Address"]);
                    nextItem.LocationCoordinates = BuildCoordinatesString(e["MeetingTimeSlot"]["Location"]["Coordinates"]);
                }

                meetingTimes.Add(nextItem);
            }

            return(meetingTimes);
        }
 private void ItemSelected(MeetingTimeCandidate item)
 {
     OnOk();
     GoBack();
 }
 private void ItemSelected(MeetingTimeCandidate item)
 {
     GoBack();
     UI.Publish(item);
 }