2015-01-28 3 views
0

Windows Phone 8.1 응용 프로그램에서 작업 중이며이 응용 프로그램은 일정에서 모임을 가져오고 싶습니다. 나는이 같은 모든 약속을 얻기 위해 Windows 런타임 API를 사용하고 있습니다 : 사실Windows.ApplicationModel.Appointments.Appointment의 초대 대상자/세부 정보가 비어있는 이유

AppointmentStore appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly); 

IReadOnlyList<Windows.ApplicationModel.Appointments.Appointment> appointments = await appointmentStore.FindAppointmentsAsync(DateTime.Now, TimeSpan.FromHours(24)); ; 
     foreach (var appointment in appointments) 
     { 
      var persistentId = appointment.RoamingId; 
      var details = appointment.Details;//the details is empty, why 
      var invitees = appointment.Invitees;//the invitees is also empty, why? 
     } 

을, 나는이 내용과 참석자 (초대)를 얻을 수 있으며, 마이크로 소프트 전화 API를 시도했다. 그러나 Microsoft 전화 API 약속 ID를 가져올 수 없습니다. 아무도 내게 약간의 약속 ID와 세부 사항/피 인용자를 얻는 방법을 알려줄 수 있습니까? 감사! 그것은 무하마드을 works.Thank

Appointments appts = new Appointments(); 

      //Identify the method that runs after the asynchronous search completes. 
      appts.SearchCompleted += new EventHandler<AppointmentsSearchEventArgs>(Calendar_SearchCompleted); 

      DateTime start = DateTime.Now; 
      DateTime end = start.AddDays(1); 
      int max = 100; 
      appts.SearchAsync(start, end, max, "test"); 

private async void Calendar_SearchCompleted(object sender, AppointmentsSearchEventArgs e) 
    { 
     foreach (Microsoft.Phone.UserData.Appointment appt in e.Results) 
     { 
      var details = appt.Details;//I can get the details 

      var participants = new ObservableCollection<Person>(); 
      var attendees = appt.Attendees; 
      if (attendees != null) 
      { 
       foreach (var attende in attendees) 
       { 
        Person attendPerson = new Person() 
        { 
         Email = attende.EmailAddress, 
         FullName = attende.DisplayName, 
         PersonID = attende.EmailAddress 
        }; 

        participants.Add(attendPerson); 
       } 

      } 



      .... 
     } 
    } 

답변

2

당신이 원하는대로 상세하게 얻을 얻을 FindAppointmentsOptions를 추가 할 필요, 코드

AppointmentStore appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly); 

     FindAppointmentsOptions options = new FindAppointmentsOptions(); 
     options.MaxCount = 100; 
     options.FetchProperties.Add(AppointmentProperties.Subject); 
     options.FetchProperties.Add(AppointmentProperties.Location); 
     options.FetchProperties.Add(AppointmentProperties.Invitees); 
     options.FetchProperties.Add(AppointmentProperties.Details); 
     options.FetchProperties.Add(AppointmentProperties.StartTime); 
     options.FetchProperties.Add(AppointmentProperties.ReplyTime); 
     IReadOnlyList<Windows.ApplicationModel.Appointments.Appointment> appointments = await appointmentStore.FindAppointmentsAsync(DateTime.Now, TimeSpan.FromHours(24), options); 
     foreach (var appointment in appointments) 
     { 
      var persistentId = appointment.RoamingId; 
      var details = appointment.Details;//the details is empty, why 
      var invitees = appointment.Invitees;//the invitees is also empty, why? 
     } 
+0

아래 시도! – yuxhu

관련 문제