共用方式為


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,則不會傳回任何約會。 即使約會存在於 StartTimerangeStart 值完全相同的裝置上,傳回的清單也會是空的。

傳回

非同步作業,會在成功完成時傳回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,則不會傳回任何約會。 即使約會存在於 StartTimerangeStart 值完全相同的裝置上,傳回的清單也會是空的。

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成員。 如需詳細資訊,請參閱下列範例。

另請參閱

適用於