【问题标题】:How to access specific calendar appointments in windowsphone如何在 windowsphone 中访问特定的日历约会
【发布时间】:2014-06-12 07:10:40
【问题描述】:

我想访问 windows phone 8 中的日历约会。 我正在使用以下代码。此代码将检索所有约会:

    private void ButtonAppointments_Click(object sender, RoutedEventArgs e)
{
    Appointments appts = new Appointments();

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

    DateTime start = DateTime.Now;
    DateTime end = start.AddDays(7);
    int max = 20;

    //Start the asynchronous search.
    appts.SearchAsync(start, end, max, "Appointments Test #1");
}

但我想获取并显示特定的日历。 例如,我的 Outlook 帐户中有三个日历:Mike 的日历、工作的日历、生日日历。我只想在我的应用中显示 Mike 的日历约会

在默认日历中,我们可以轻松隐藏或显示特定日历,但我们如何在自己的应用程序中做类似的事情????

【问题讨论】:

    标签: c# windows-phone-8 calendar appointment


    【解决方案1】:

    有 Windows 运行时 API 来获取不同的日历。

     AppointmentStore appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly);
    
                var appCalendars = await appointmentStore.FindAppointmentCalendarsAsync();
                foreach (var calendar in appCalendars)
                {
                }

    appCalendars 是你想要的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-16
      • 2021-12-20
      • 1970-01-01
      • 1970-01-01
      • 2021-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多