AppointmentStore.FindAppointmentsAsync 方法

定义

重载

FindAppointmentsAsync(DateTime, TimeSpan)

检索约会日历中指定日期范围内的约会列表。

FindAppointmentsAsync(DateTime, TimeSpan, FindAppointmentsOptions)

检索约会日历中属于指定日期范围且满足提供的 FindAppointmentsOptions 对象指定的条件的约会列表。

FindAppointmentsAsync(DateTime, TimeSpan)

检索约会日历中指定日期范围内的约会列表。

public:
 virtual IAsyncOperation<IVectorView<Appointment ^> ^> ^ FindAppointmentsAsync(DateTime rangeStart, TimeSpan rangeLength) = FindAppointmentsAsync;
/// [Windows.Foundation.Metadata.Overload("FindAppointmentsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<Appointment>> FindAppointmentsAsync(DateTime const& rangeStart, TimeSpan const& rangeLength);
[Windows.Foundation.Metadata.Overload("FindAppointmentsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<Appointment>> FindAppointmentsAsync(System.DateTimeOffset rangeStart, System.TimeSpan rangeLength);
function findAppointmentsAsync(rangeStart, rangeLength)
Public Function FindAppointmentsAsync (rangeStart As DateTimeOffset, rangeLength As TimeSpan) As IAsyncOperation(Of IReadOnlyList(Of Appointment))

参数

rangeStart
DateTime DateTimeOffset

检索约会的日期范围的开始日期。

rangeLength
TimeSpan TimeSpan

检索约会的日期范围的长度。 如果将 rangeLength 参数设置为 0,则不会返回任何约会。 即使约会存在于具有与 rangeStart 值完全相同的 StartTime 的设备上,返回的列表也将为空。

返回

成功完成后返回 Appointment 对象的 IVectorView 列表的异步操作。

属性

Windows 要求

应用功能
appointmentsSystem

另请参阅

适用于

FindAppointmentsAsync(DateTime, TimeSpan, FindAppointmentsOptions)

检索约会日历中属于指定日期范围且满足提供的 FindAppointmentsOptions 对象指定的条件的约会列表。

public:
 virtual IAsyncOperation<IVectorView<Appointment ^> ^> ^ FindAppointmentsAsync(DateTime rangeStart, TimeSpan rangeLength, FindAppointmentsOptions ^ options) = FindAppointmentsAsync;
/// [Windows.Foundation.Metadata.Overload("FindAppointmentsAsyncWithOptions")]
IAsyncOperation<IVectorView<Appointment>> FindAppointmentsAsync(DateTime const& rangeStart, TimeSpan const& rangeLength, FindAppointmentsOptions const& options);
[Windows.Foundation.Metadata.Overload("FindAppointmentsAsyncWithOptions")]
public IAsyncOperation<IReadOnlyList<Appointment>> FindAppointmentsAsync(System.DateTimeOffset rangeStart, System.TimeSpan rangeLength, FindAppointmentsOptions options);
function findAppointmentsAsync(rangeStart, rangeLength, options)
Public Function FindAppointmentsAsync (rangeStart As DateTimeOffset, rangeLength As TimeSpan, options As FindAppointmentsOptions) As IAsyncOperation(Of IReadOnlyList(Of Appointment))

参数

rangeStart
DateTime DateTimeOffset

检索约会的日期范围的开始日期。

rangeLength
TimeSpan TimeSpan

检索约会的日期范围的长度。 如果将 rangeLength 参数设置为 0,则不会返回任何约会。 即使约会存在于具有与 rangeStart 值完全相同的 StartTime 的设备上,返回的列表也将为空。

options
FindAppointmentsOptions

一个 FindAppointmentsOptions 对象,用于指定此操作的更多选项。 必须设置 options 参数才能指定要检索的值。

返回

成功完成后返回 Appointment 对象的 IVectorView 列表的异步操作。

属性

Windows 要求

应用功能
appointmentsSystem

示例

设置 FindAppointmentOptions.FetchProperties 以指定要检索的值。

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

// Specify which values to retrieve
FindAppointmentsOptions options = new FindAppointmentsOptions(); 
options.FetchProperties.Add(AppointmentProperties.Subject); 
options.FetchProperties.Add(AppointmentProperties.Details); 
options.FetchProperties.Add(AppointmentProperties.DetailsKind);

var iteratingAppointments = await calendar.FindAppointmentsAsync(DateTimeOffset.Now, TimeSpan.FromDays(31), options);

foreach (var i in iteratingAppointments) 
{ 
  // do stuff with each appointment 
}

注解

重要

出于性能原因, FindAppointmentsAsync 不会加载大多数属性。 若要加载特定属性,请将值添加到 options 参数中的 FindAppointmentsOptions.FetchProperties 成员。 有关详细信息,请参阅以下示例。

另请参阅

适用于