StructDateTimeInterval
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
DateTimeInterval(int, int)
Initializes a new instance of the DateTimeInterval struct.
DateTimeInterval(int, int, int)
Initializes a new instance of the DateTimeInterval struct.
DateTimeInterval(int, int, int, int)
Initializes a new instance of the DateTimeInterval struct.
DateTimeInterval(int, int, int, int, int)
Initializes a new instance of the DateTimeInterval struct.
Fields
Zero
Identifies DateTimeInterval of zero duration.
Declaration
public static readonly DateTimeInterval Zero
Field Value
Properties
Methods
ConvertToTimeSpan(DateTimeInterval)
Converts the given DateTimeInterval to TimeSpan.
Declaration
public static TimeSpan ConvertToTimeSpan(DateTimeInterval interval)
Parameters
interval
DateTimeInterval.
Returns
TimeSpan.
Equals(DateTimeInterval)
Indicates whether this instance and a specified DateTimeInterval are equal.
Declaration
public bool Equals(DateTimeInterval other)
Parameters
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
Equals(object)
Indicates whether this instance and a specified object are equal.
FromDays(int)
Creates a new DateTimeInterval initializing it with given days.
Declaration
public static DateTimeInterval FromDays(int days)
Parameters
days
The days, which will be used to initialize the DateTimeInterval.
Returns
A new DateTimeInterval.
FromMonths(int)
Creates a new DateTimeInterval initializing it with given months.
Declaration
public static DateTimeInterval FromMonths(int months)
Parameters
months
The months, which will be used to initialize the DateTimeInterval.
Returns
A new DateTimeInterval.
GetApproximateTotalDays(Calendar)
Gets the approximate total days count for the specified calendar.
Uses Today's year for the calculate.
Declaration
public int GetApproximateTotalDays(Calendar calendar)
Parameters
calendar
The calendar object.
Returns
Total days that this DateTimeInterval represents for the given calendar.
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
A 32-bit signed integer that is the hash code for this instance.
Overrides
Parse(string)
Constructs a new DateTimeInterval object from a string. The string should be in
format like this: 12d 12m.
Declaration
public static DateTimeInterval Parse(string value)
Parameters
value
A string that specifies the interval.
Returns
A DateTimeInterval that corresponds to value.
Exceptions
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.
TryParse(string, out DateTimeInterval)
Constructs a new DateTimeInterval object from a string. The string should be in
format like this: 12d 12m.
Declaration
public static bool TryParse(string value, out DateTimeInterval interval)
Parameters
value
A string that specifies the interval.
interval
The 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
operator !=(DateTimeInterval, DateTimeInterval)
Implements the operator !=.
Declaration
public static bool operator !=(DateTimeInterval self, DateTimeInterval other)
Parameters
self
The self.
other
The other.
Returns
True if self did not equals other.
operator ==(DateTimeInterval, DateTimeInterval)
Implements the operator ==.
Declaration
public static bool operator ==(DateTimeInterval self, DateTimeInterval other)
Parameters
self
The self.
other
The other.
Returns
The result of the operator.