Bearbeiten

Freigeben über


EKEventStore.EnumerateEvents(NSPredicate, EKEventSearchCallback) Method

Definition

Enumerates all of the events that match the specified predicate.

[Foundation.Export("enumerateEventsMatchingPredicate:usingBlock:")]
public virtual void EnumerateEvents (Foundation.NSPredicate predicate, EventKit.EKEventSearchCallback block);
abstract member EnumerateEvents : Foundation.NSPredicate * EventKit.EKEventSearchCallback -> unit
override this.EnumerateEvents : Foundation.NSPredicate * EventKit.EKEventSearchCallback -> unit

Parameters

predicate
NSPredicate

A predicate for the events you want to enumerate.

block
EKEventSearchCallback

The method to invoke for each event that matches the predicate.

Attributes

Remarks

var yesterday = DateTime.Now - TimeSpan.FromDays (1);
var twoMonthsInFuture = DateTime.Now + TimeSpan.FromDays (60);

var predicate = myStore.PredicateForEvents (yesterday, twoMonthsInFuture, null);
var MyStore = new EKEventStore ();

MyStore.EnumerateEvents (predicate, (EKEvent theEvent, ref bool stop) => {
	Console.WriteLine ("Got the event: {0}", theEvent);
});

Applies to