WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RecurrenceList - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RecurrenceList

    Encapsulates the idea of a recurrence defintion. Its purpose is to accept a recurrence definition (either as a string or as RecurrenceRules) and allow you to easily decide whether particular date satisfies the defineition of recurrence. The class derives from ArrayList. The ArayList may (depending upon EnableDateCache) hold a list of known valid recurrent dates. This list is dynamic, and will grow as you use the method IsValidRecurrence(DateTime) to determine whether a date satisfies the definition of recurrence.

    Inheritance
    System.Object
    System.Collections.ArrayList
    RecurrenceList
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    System.ICloneable
    Inherited Members
    System.Collections.ArrayList.Adapter(System.Collections.IList)
    System.Collections.ArrayList.Add(System.Object)
    System.Collections.ArrayList.AddRange(System.Collections.ICollection)
    System.Collections.ArrayList.BinarySearch(System.Int32, System.Int32, System.Object, System.Collections.IComparer)
    System.Collections.ArrayList.BinarySearch(System.Object)
    System.Collections.ArrayList.BinarySearch(System.Object, System.Collections.IComparer)
    System.Collections.ArrayList.Clear()
    System.Collections.ArrayList.Clone()
    System.Collections.ArrayList.Contains(System.Object)
    System.Collections.ArrayList.CopyTo(System.Array)
    System.Collections.ArrayList.CopyTo(System.Array, System.Int32)
    System.Collections.ArrayList.CopyTo(System.Int32, System.Array, System.Int32, System.Int32)
    System.Collections.ArrayList.FixedSize(System.Collections.IList)
    System.Collections.ArrayList.FixedSize(System.Collections.ArrayList)
    System.Collections.ArrayList.GetEnumerator()
    System.Collections.ArrayList.GetEnumerator(System.Int32, System.Int32)
    System.Collections.ArrayList.IndexOf(System.Object)
    System.Collections.ArrayList.IndexOf(System.Object, System.Int32)
    System.Collections.ArrayList.IndexOf(System.Object, System.Int32, System.Int32)
    System.Collections.ArrayList.Insert(System.Int32, System.Object)
    System.Collections.ArrayList.InsertRange(System.Int32, System.Collections.ICollection)
    System.Collections.ArrayList.LastIndexOf(System.Object)
    System.Collections.ArrayList.LastIndexOf(System.Object, System.Int32)
    System.Collections.ArrayList.LastIndexOf(System.Object, System.Int32, System.Int32)
    System.Collections.ArrayList.ReadOnly(System.Collections.IList)
    System.Collections.ArrayList.ReadOnly(System.Collections.ArrayList)
    System.Collections.ArrayList.Remove(System.Object)
    System.Collections.ArrayList.RemoveAt(System.Int32)
    System.Collections.ArrayList.RemoveRange(System.Int32, System.Int32)
    System.Collections.ArrayList.Repeat(System.Object, System.Int32)
    System.Collections.ArrayList.Reverse()
    System.Collections.ArrayList.Reverse(System.Int32, System.Int32)
    System.Collections.ArrayList.SetRange(System.Int32, System.Collections.ICollection)
    System.Collections.ArrayList.GetRange(System.Int32, System.Int32)
    System.Collections.ArrayList.Sort()
    System.Collections.ArrayList.Sort(System.Collections.IComparer)
    System.Collections.ArrayList.Sort(System.Int32, System.Int32, System.Collections.IComparer)
    System.Collections.ArrayList.Synchronized(System.Collections.IList)
    System.Collections.ArrayList.Synchronized(System.Collections.ArrayList)
    System.Collections.ArrayList.ToArray()
    System.Collections.ArrayList.ToArray(System.Type)
    System.Collections.ArrayList.TrimToSize()
    System.Collections.ArrayList.Capacity
    System.Collections.ArrayList.Count
    System.Collections.ArrayList.IsFixedSize
    System.Collections.ArrayList.IsReadOnly
    System.Collections.ArrayList.IsSynchronized
    System.Collections.ArrayList.SyncRoot
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Schedule
    Assembly: Syncfusion.Schedule.Base.dll
    Syntax
    public class RecurrenceList : ArrayList, IList, ICollection, IEnumerable, ICloneable

    Constructors

    RecurrenceList()

    Initializes a new instance of the RecurrenceList class.

    Declaration
    public RecurrenceList()

    RecurrenceList(RecurrenceRule, DateTime, IScheduleAppointment)

    Initializes a new instance of the RecurrenceList class. Uses a RecurenceRule and BaseDate to define the recurrence.

    Declaration
    public RecurrenceList(RecurrenceRule rule, DateTime baseDate, IScheduleAppointment appointment)
    Parameters
    Type Name Description
    RecurrenceRule rule

    The recurrence rule.

    System.DateTime baseDate

    The basedate.

    IScheduleAppointment appointment

    Defines the appointment associated with this recurrence.

    RecurrenceList(DateTime[], IScheduleAppointment)

    Initializes a new instance of the RecurrenceList class. Accepts a fixed list of dates.

    Declaration
    public RecurrenceList(DateTime[] dates, IScheduleAppointment appointment)
    Parameters
    Type Name Description
    System.DateTime[] dates

    An Array of DateTime values.

    IScheduleAppointment appointment

    Defines the appointment associated with this recurrence.

    Remarks

    This constructor allows you to specify a recurrence as a fix set of dates. So, if you want to set up a series of 5 meetings on 5 different dates, then you can use this constructor to do so as a recurring appointment.

    RecurrenceList(String, DateTime, IScheduleAppointment)

    Initializes a new instance of the RecurrenceList class. Accepts a string rule and a base date to define the recurrence.

    Declaration
    public RecurrenceList(string rule, DateTime baseDate, IScheduleAppointment appointment)
    Parameters
    Type Name Description
    System.String rule

    The string rule. Text

    System.DateTime baseDate

    The base date.

    IScheduleAppointment appointment

    Defines the appointment associated with this recurrence.

    Properties

    Appointment

    Gets or sets appointment information for this recurring event.

    Declaration
    public IScheduleAppointment Appointment { get; set; }
    Property Value
    Type Description
    IScheduleAppointment
    Remarks

    When a Calendar is displaying a date that holds a recurring appointment, the information provided through this property will be used to create a placeholder appointment for this recurring event.

    BaseDate

    Gets or sets the start date for this recurrence.

    Declaration
    public DateTime BaseDate { get; set; }
    Property Value
    Type Description
    System.DateTime
    Remarks

    This value should be the earliest possible date that you want to be considered for this set of recurrences.

    EnableDateCache

    Gets or sets a value indicating whether this RecurrencList maintains a list of dates that satisfies the recurrence definition.

    Declaration
    public bool EnableDateCache { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    If this property is true, the ReccurenceList is an ArrayList object hodling a sorted list of the known occurrences to date. The list is fully populated in the sense that all dates between the first date in that list and the last date in the list which satisfy the recurrence definintion are also in the list. This list is used in the IsValidRecurrence(DateTime) method to check for occurences. This method first checks whether the requested date is in the list which means the method returns true. If not, it checks to see if the requested date is less than teh last date in the list, and if so, returns false. Finally, if the requested date is beyond the dates in the list, the method computes new dates that satisfy the rule and adds them to the list until ether the requested date is found, or exceeded. This means that the list dynamically grows as you request further and further dates into the future. This dynamic list technique makes validating dates to be very efficient at the expense of the memory load of maintaining the date list.

    Item[Int32]

    Gets of sets the ith date in this RecurrentList.

    Declaration
    public DateTime this[int i] { get; set; }
    Parameters
    Type Name Description
    System.Int32 i

    The requested index.

    Property Value
    Type Description
    System.DateTime

    A date satisfying this recurrence.

    Rules

    Gets or sets an array of RecurrenceRules that defines this recurrence collection.

    Declaration
    public RecurrenceRule[] Rules { get; set; }
    Property Value
    Type Description
    RecurrenceRule[]

    RuleString

    Gets or sets a string that defines this recurrence collection.

    Declaration
    public string RuleString { get; set; }
    Property Value
    Type Description
    System.String
    Remarks

    The string may be a simple rule that qualifies (Text for sample rules). It also can be several simple rules appended together with semicolons. This RuleString is equivalent to the collection of Rules in that both RuleString and Rules define exactly the same set of recurrent dates.

    TerminalDate

    Gets or sets the last date associated with this recurrence definition.

    Declaration
    public DateTime TerminalDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    Methods

    IsValidRecurrence(DateTime)

    Determines whether the given date satisfies the recurrence definition.

    Declaration
    public bool IsValidRecurrence(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to be tested.

    Returns
    Type Description
    System.Boolean

    True is the date satisfies the recurrence definition.

    Remarks

    If EnableDateCache is true, then this routine first does a binary search on the dates that are cached in the underlying ArrayList. If the date is not found and exceeds the last cached date, then Syncfusion.Schedule.RecurrenceSupport.GetFirstDate is called with a base date of the last known cached recurrence date. Then GetNextDate is continually called until either the given date is found to satisfy the recurrence, or the given date has been exceeded. As the dates are generated, they are inserted into the underlying ArrayList, extending the known date cache. Care is taken to insert the new dates properly so the underlying date cache is always sorted, and BinarySearch is valid. If EnableDateCache is false, then no searching is attempted in the cache which is always empty. Instead, GetFirstDate is always called with the BaseDate, and the GetNextDate is called until the given date is found or exceeded. There is no cacheing involved and all checks require starting at the beginning and computing all the dates from scratch everytime.

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    System.ICloneable

    Extension Methods

    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    FunctionalExtensions.MoveTo(IList, Int32, Int32)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved