RecurrenceAll Instances Method
This method is used to return all recurring instances based on the current settings alone
Definition
Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
Returns a DateTimeCollection of DateTime objects that represent all instances found using the current settings.
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2025.1.9.0
C#
public DateTimeCollection AllInstances()VB
Public Function AllInstances As DateTimeCollectionC++
public:
DateTimeCollection^ AllInstances()F#
member AllInstances : unit -> DateTimeCollection Return Value
DateTimeCollectionReturns a DateTimeCollection of DateTime objects that represent all instances found using the current settings.
Remarks
This is best used with a recurrence that ends after a specific number of occurrences or by a
specific date. If set to never end, this will return a really large collection of dates.
Example
This example shows the use of the RecurUntil and the AllInstances
methods for data binding. The InstancesBetween method could be used in
place of AllInstances if the recurrence was set to never end.
C#
protected System.Web.UI.WebControls.DropDownList cboNewDate;
DateTime dtFirstDate = DateTime.Today;
// Only let the user pick a date that falls on a Monday that is between 1 week and
// 6 months from today.
Recurrence rRecur = new Recurrence();
rRecur.RecurWeekly(1, DaysOfWeek.Monday);
rRecur.StartDateTime = dtFirstDate.AddDays(7);
rRecur.RecurUntil = dtFirstDate.AddMonths(6);
cboNewDate.DataTextFormatString = "{0:d}";
cboNewDate.DataSource = rRecur.AllInstances();
cboNewDate.DataBind();VB
Protected WithEvents cboNewDate As System.Web.UI.WebControls.DropDownList
Dim dtFirstDate As DateTime = DateTime.Today
' Only let the user pick a date that falls on a Monday that is between 1 week and
' 6 months from today.
Dim rRecur As New Recurrence()
rRecur.RecurWeekly(1, DaysOfWeek.Monday)
rRecur.StartDateTime = dtFirstDate.AddDays(7)
rRecur.RecurUntil = dtFirstDate.AddMonths(6)
cboNewDate.DataTextFormatString = "{0:d}"
cboNewDate.DataSource = rRecur.AllInstances()
cboNewDate.DataBind()C++
No code example is currently available or this language may not be supported.F#
No code example is currently available or this language may not be supported.