This is a migrated thread and some comments may be shown as answers.

Recurrence rule occurences

1 Answer 35 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
arockiasamy
Top achievements
Rank 1
arockiasamy asked on 02 Aug 2010, 03:57 PM

 

dear sir,
RecurrenceRule
rrule = Telerik.Web.UI.RecurrenceRule.TryParse(lvl_recurringsms[0].Recurrenceinfo);

 

 

foreach (DateTime occurrence in rrule.Occurrences)

 

{

 

Console.WriteLine("\t{0}", occurrence);

 

}

 

How to filter the occurences here. Need of syntax and methods (predicate T souce)

 

rrule.Occurrences.Where<T predicate

>

Kind regards.
Arockiasamy.I

 

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 04 Aug 2010, 02:34 PM
Hello arockiasamy,

Where<T predicate> is an extension method. It is used when you are trying to filter a collection by some criteria. For predicate you can use delegate or lambda expressions.

Here's an example:

If we have a list of numbers:

List<int> myList = new List<int>{1,2,3,4,5,6};

If you want to find all the even numbers in this collection you can use this:

var evenNumbers = myList.Where(i => i % 2 == 0);

The result will be: 2,4 and 6 as expected.

Could you be more specific about your requirement? By what criteria you want to filter the Occurences?

Kind regards,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
arockiasamy
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or