Class ICalDuration
An iCalendar duration value (RFC 5545 §3.3.6, ISO 8601 duration). For example,
P1DT2H30M represents 1 day, 2 hours, and 30 minutes.
Inherited Members
Namespace: DRIT.Mail.Rfc.ICal
Assembly: DRIT.Mail.dll
Syntax
public sealed class ICalDuration
Constructors
View SourceICalDuration(TimeSpan)
Initializes a new instance of the ICalDuration class.
Declaration
public ICalDuration(TimeSpan value)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | value | The duration as a TimeSpan. |
Properties
View SourceIsNegative
Gets a value indicating whether the duration is negative.
Declaration
public bool IsNegative { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Value
Gets the duration as a TimeSpan.
Declaration
public TimeSpan Value { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Methods
View SourceParse(string)
Parses an iCalendar duration string (RFC 5545 §3.3.6). Supports formats such as
P1D, P1W, PT1H30M, P1DT2H30M, -P1D.
Declaration
public static ICalDuration Parse(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | Specifies the text value. |
Returns
| Type | Description |
|---|---|
| ICalDuration |
ToString()
Formats this duration for iCalendar serialization (e.g. P1DT2H30M).
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |