Delen via


AppointmentCalendar.FindAppointmentsAsync Method

Definition

Overloads

FindAppointmentsAsync(DateTime, TimeSpan)

Asynchronously retrieves a list of appointments belonging to the current AppointmentCalendar that meet the specified criteria.

FindAppointmentsAsync(DateTime, TimeSpan, FindAppointmentsOptions)

Asynchronously retrieves a list of appointments belonging to the current AppointmentCalendar that meet the specified criteria.

FindAppointmentsAsync(DateTime, TimeSpan)

Asynchronously retrieves a list of appointments belonging to the current AppointmentCalendar that meet the specified criteria.

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))

Parameters

rangeStart
DateTime DateTimeOffset

The start time of the time window for which appointments are retrieved.

rangeLength
TimeSpan TimeSpan

The length of the time window for which appointments are retrieved. If the rangeLength parameter is set to 0, no appointments will be returned. Even if appointments exist on the device that have a StartTime that is exactly the same as the rangeStart value, the returned list will be empty.

Returns

An asynchronous operation that returns an IVectorView list of Appointment objects upon successful completion.

Attributes

Windows requirements

App capabilities
appointmentsSystem

See also

Applies to

FindAppointmentsAsync(DateTime, TimeSpan, FindAppointmentsOptions)

Asynchronously retrieves a list of appointments belonging to the current AppointmentCalendar that meet the specified criteria.

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))

Parameters

rangeStart
DateTime DateTimeOffset

The start time of the time window for which appointments are retrieved.

rangeLength
TimeSpan TimeSpan

The length of the time window for which appointments are retrieved. If the rangeLength parameter is set to 0, no appointments will be returned. Even if appointments exist on the device that have a StartTime that is exactly the same as the rangeStart value, the returned list will be empty.

options
FindAppointmentsOptions

A FindAppointmentsOptions object that is used to specify more options for this operation. You must set the options parameter to specify the values to retrieve.

Returns

An asynchronous operation that returns an IVectorView list of Appointment objects upon successful completion.

Attributes

Windows requirements

App capabilities
appointmentsSystem

Examples

Set FindAppointmentOptions.FetchProperties to specify the values to retrieve.

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 
}

Remarks

Important

For performance reasons, FindAppointmentsAsync will not load most properties. To load specific properties, add values to the FindAppointmentsOptions.FetchProperties member in the options parameter.

See also

Applies to