RecurrenceAllInstances Method
This method is used to return all recurring instances based on the current settings alone
Namespace: EWSoftware.PDIAssembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public DateTimeCollection AllInstances()
Public Function AllInstances As DateTimeCollection
public:
DateTimeCollection^ AllInstances()
member AllInstances : unit -> DateTimeCollection
Return Value
DateTimeCollectionReturns a
DateTimeCollection of
DateTime objects that represent
all instances found using the current settings.
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.
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.
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();
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()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.