DateAndOrTime Class

A union that encapsulates data that describes a date and/or a time. The encapsulated data can be either a DateOnly value, a DateTimeOffset value, a TimeOnly value, or a String.

Definition

Namespace: FolkerKinzel.VCards.Models
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public abstract class DateAndOrTime : IEquatable<DateAndOrTime>
Inheritance
Object    DateAndOrTime
Implements
IEquatableDateAndOrTime

Constructors

DateAndOrTimeInitializes a new instance of the DateAndOrTime class

Properties

DateOnly Gets the encapsulated DateOnly value, or null, if the encapsulated value has a different Type.
DateTimeOffset Gets the encapsulated DateTimeOffset value, or null, if the encapsulated value has a different Type.
HasDay Gets a value indicating whether the encapsulated data contains information about the day.
HasMonth Gets a value indicating whether the encapsulated data contains information about the month.
HasYear Gets a value indicating whether the encapsulated data contains information about the year.
IsEmptytrue if the instance contains no data, otherwise false.
String Gets the encapsulated String, or null, if the encapsulated value has a different Type.
TimeOnly Gets the encapsulated TimeOnly value, or null, if the encapsulated value has a different Type.

Methods

AsString Converts the encapsulated data to a String.
ConvertTResult(FuncDateOnly, TResult, FuncDateTimeOffset, TResult, FuncTimeOnly, TResult, FuncString, TResult) Converts the encapsulated value to TResult.
ConvertTArg, TResult(TArg, FuncDateOnly, TArg, TResult, FuncDateTimeOffset, TArg, TResult, FuncTimeOnly, TArg, TResult, FuncString, TArg, TResult) Converts the encapsulated value to TResult and allows to specify an argument for the conversion.
Create(String) Creates a new DateAndOrTime instance from free-form text.
Create(TimeOnly) Creates a new DateAndOrTime instance from a TimeOnly value.
Create(DateOnly, Boolean, Boolean, Boolean) Creates a new DateAndOrTime instance from a DateOnly value.
Create(DateTimeOffset, Boolean, Boolean, Boolean) Creates a new DateAndOrTime instance from a DateTimeOffset value.
Equals(DateAndOrTime)Indicates whether the current object is equal to another object of the same type.
Equals(Object)Determines whether the specified object is equal to the current object.
(Overrides ObjectEquals(Object))
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Overrides ObjectGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Switch(ActionDateOnly, ActionDateTimeOffset, ActionTimeOnly, ActionString) Performs an ActionT depending on the Type of the encapsulated value.
SwitchTArg(TArg, ActionDateOnly, TArg, ActionDateTimeOffset, TArg, ActionTimeOnly, TArg, ActionString, TArg) Performs an ActionT depending on the Type of the encapsulated value and allows to pass an argument to the delegates.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryAsDateOnly Tries to convert the encapsulated data to a DateOnly value.
TryAsDateTimeOffset Tries to convert the encapsulated data to a DateTimeOffset value.
TryAsTimeOnly Tries to convert the encapsulated data to a TimeOnly value.

Operators

Equality(DateAndOrTime, DateAndOrTime) Overloads the equality operator for DateAndOrTime instances.
(DateOnly to DateAndOrTime) Defines an implicit conversion of a DateOnly value to a DateAndOrTime object.
(DateTime to DateAndOrTime) Defines an implicit conversion of a DateTime value to a DateAndOrTime object.
(DateTimeOffset to DateAndOrTime) Defines an implicit conversion of a DateTimeOffset value to a DateAndOrTime object.
(String to DateAndOrTime) Defines an implicit conversion of a String to a DateAndOrTime object.
(TimeOnly to DateAndOrTime) Defines an implicit conversion of a TimeOnly value to a DateAndOrTime object.
Inequality(DateAndOrTime, DateAndOrTime) Overloads the not-equal-to operator for DateAndOrTime instances.

See Also