RecurrenceRule
Provides the abstract base class for recurrence rules.
Notes to implementers: This base class is provided to make it easier for implementers to create a recurrence rule. Implementers are encouraged to extend this base class instead of creating their own.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[TypeConverter(typeof(RecurrenceRuleConverter))]
public abstract class RecurrenceRule : ISerializable, IEquatable<RecurrenceRule>
Inheritance: objectRecurrenceRule
Derived Classes:
Implements:
Inherited Members
Constructors
protected RecurrenceRule()
protected RecurrenceRule(SerializationInfo info, StreamingContext context)
Fields
Represents an empty recurrence rule
public static readonly RecurrenceRule Empty
protected RecurrencePattern rulePattern
protected RecurrenceRange ruleRange
Properties
protected DateTime EffectiveStart { get; }
Gets or sets a list of the exception dates associated with this recurrence rule.
public virtual IList<DateTime> Exceptions { get; set; }
A list of the exception dates associated with this recurrence rule.
Any date placed in the list will be considered a recurrence exception, i.e. an occurrence will not be generated for that date. The dates must be in universal time.
Gets a value indicating whether this recurrence rule has associated exceptions.
public bool HasExceptions { get; }
True if this recurrence rule has associated exceptions, false otherwise.
Gets a value indicating whether this recurrence rule yields any occurrences.
public bool HasOccurrences { get; }
True this recurrence rule yields any occurrences, false otherwise.
Gets or sets the maximum candidates limit.
public int MaximumCandidates { get; set; }
The maximum candidates limit.
This limit is used to prevent lockups when evaluating infinite rules without using SetEffectiveRange. The default value should not be changed under normal conditions.
Gets the evaluated occurrence times of this recurrence rule.
public virtual IEnumerable<DateTime> Occurrences { get; }
The evaluated occurrence times of this recurrence rule.
Occurrence times are in UTC.
Gets the RecurrencePattern associated with this recurrence rule.
public RecurrencePattern Pattern { get; }
The RecurrencePattern associated with this recurrence rule.
Gets the RecurrenceRange associated with this recurrence rule.
public RecurrenceRange Range { get; }
The RecurrenceRange associated with this recurrence rule.
By calling SetEffectiveRange(DateTime, DateTime) the range of the generated occurrences can be narrowed.
Methods
Clears the effective range set by calling SetEffectiveRange(DateTime, DateTime).
public void ClearEffectiveRange()
If no effective range was set, calling this method has no effect.
Overloaded. Overridden. Returns a value indicating whether this instance is equal to a specified object.
public override bool Equals(object obj)
An object to compare with this instance.
Returns:true if value is an instance of RecurrenceRule and equals the value of this instance; otherwise, false.
Overrides:
Overloaded. Overridden. Returns a value indicating whether this instance is equal to a specified RecurrenceRule object.
public bool Equals(RecurrenceRule other)
An RecurrenceRule object to compare with this instance.
Returns:true if value equals the value of this instance; otherwise, false.
Implements:
Creates a recurrence rule with the specified pattern and range.
public static RecurrenceRule FromPatternAndRange(RecurrencePattern pattern, RecurrenceRange range)
The recurrence pattern.
rangeRecurrenceRangeThe recurrence range.
Returns:The constructed recurrence rule.
Overriden. Returns the hash code for this instance.
Populates a SerializationInfo with the data needed to serialize this object.
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
The SerializationInfo to populate with data.
contextStreamingContextThe destination (see StreamingContext) for this serialization.
Implements:
protected static bool IsValidValue<T>(T value, T minValue, T maxValue) where T : IComparable
Specifies the effective range for evaluating occurrences.
public void SetEffectiveRange(DateTime start, DateTime end)
The starting date of the effective range.
endDateTimeThe ending date of the effective range.
Exceptions: ArgumentExceptionEnd date is before Start date.
The range is inclusive. To clear the effective range call ClearEffectiveRange().
Converts the recurrence rule to it's equivalent string representation.
public override string ToString()
The string representation of this recurrence rule.
Overrides:
The string representation is based on the iCalendar data format (RFC 2445).
public string ToString(TimeZoneInfoProvider provider)
Creates a recurrence rule instance from it's string representation.
public static bool TryParse(string input, out RecurrenceRule rrule)
The string representation to parse.
rruleRecurrenceRuleWhen this method returns, contains the recurrence rule instance, if the conversion succeeded, or null if the conversion failed. The conversion fails if the value parameter is a null reference (Nothing in Visual Basic) or represents invalid recurrence rule.
Returns:True if input was converted successfully, false otherwise.
Creates a recurrence rule instance from it's string representation, taking into account TimeZone offset.
public static bool TryParse(string input, string timeZoneID, out RecurrenceRule rrule)
The string to parse.
timeZoneIDstringThe TimeZoneID.
rruleRecurrenceRuleThe RecurrenceRule
Returns:RecurrenceRule if the parsing succeeded or null (Nothing in Visual Basic) if the parsing failed.
See the TryParse(string, out RecurrenceRule) overload for more information and examples.
Creates a recurrence rule instance from it's string representation.
public static RecurrenceRule TryParse(string input)
The string to parse.
Returns:RecurrenceRule if the parsing succeeded or null (Nothing in Visual Basic) if the parsing failed.
See the TryParse(string, out RecurrenceRule) overload for more information and examples.
protected static void ValidateValue<T>(string name, T value, T minValue, T maxValue) where T : IComparable
Operators
Determines whether two specified RecurrenceRule objects have different values.
public static bool operator !=(RecurrenceRule o1, RecurrenceRule o2)
Determines whether two specified RecurrenceRule objects have the same value.
public static bool operator ==(RecurrenceRule o1, RecurrenceRule o2)