DateTimeInterval
Represents date time duration in days and/or months.
Definition
Namespace:Telerik.Windows.Controls.ScheduleView
Assembly:Telerik.Windows.Controls.ScheduleView.dll
Syntax:
[TypeConverter(typeof(DateTimeIntervalConverter))]
public struct DateTimeInterval : IEquatable<DateTimeInterval>
Implements:
Inherited Members
Constructors
Initializes a new instance of the DateTimeInterval struct.
Initializes a new instance of the DateTimeInterval struct.
Initializes a new instance of the DateTimeInterval struct.
Fields
Identifies DateTimeInterval of zero duration.
public static readonly DateTimeInterval Zero
Properties
Methods
Converts the given DateTimeInterval to TimeSpan.
public static TimeSpan ConvertToTimeSpan(DateTimeInterval interval)
DateTimeInterval.
Returns:TimeSpan.
Indicates whether this instance and a specified DateTimeInterval are equal.
public bool Equals(DateTimeInterval other)
Another DateTimeInterval to compare to.
Returns:True if other and this instance are the same type and represent the same value; otherwise, false.
Implements:
Creates a new DateTimeInterval initializing it with given days.
public static DateTimeInterval FromDays(int days)
The days, which will be used to initialize the DateTimeInterval.
Returns:A new DateTimeInterval.
Creates a new DateTimeInterval initializing it with given months.
public static DateTimeInterval FromMonths(int months)
The months, which will be used to initialize the DateTimeInterval.
Returns:A new DateTimeInterval.
Gets the approximate total days count for the specified calendar.
Uses Today's year for the calculate.
public int GetApproximateTotalDays(Calendar calendar)
The calendar object.
Returns:Total days that this DateTimeInterval represents for the given calendar.
Returns the hash code for this instance.
public override int GetHashCode()
A 32-bit signed integer that is the hash code for this instance.
Overrides:
Constructs a new DateTimeInterval object from a string. The string should be in
format like this: 12d 12m.
public static DateTimeInterval Parse(string value)
A string that specifies the interval.
Returns:A DateTimeInterval that corresponds to value.
value is null.
value contains negative value.
value is not in the correct format. The string should be in format like
this: "{i}d {i}m" where {i} represents an int number.
Given values for Days or Months in value are less
than 0 and MaxValue.
Constructs a new DateTimeInterval object from a string. The string should be in
format like this: 12d 12m.
public static bool TryParse(string value, out DateTimeInterval interval)
A string that specifies the interval.
intervalDateTimeIntervalThe DateTimeInterval that will be created if the parsing is successful. If it failed the value will be Zero. This parameter is passed uninitialized.
Returns:True if value was converted successfully; otherwise false. This operator
returns false if value is null, has an invalid format, or the given values for
Days or Months are less than 0 and MaxValue.
Operators
Implements the operator !=.
public static bool operator !=(DateTimeInterval self, DateTimeInterval other)
The self.
otherDateTimeIntervalThe other.
Returns:True if self did not equals other.
Implements the operator ==.
public static bool operator ==(DateTimeInterval self, DateTimeInterval other)
The self.
otherDateTimeIntervalThe other.
Returns:The result of the operator.