Provides a date data type that understands the concept of an empty date value. More...
Public Types | |
enum | EmptyValue { MinDate , MaxDate } |
Indicates the empty value of a SmartDate. More... | |
Public Member Functions | |
SmartDate (bool emptyIsMin) | |
Creates a new SmartDate object. More... | |
SmartDate (EmptyValue emptyValue) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime value) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime value, bool emptyIsMin) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime value, EmptyValue emptyValue) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime value, EmptyValue emptyValue, DateTimeKind kind) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime? value) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime? value, bool emptyIsMin) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTime? value, EmptyValue emptyValue) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTimeOffset value) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTimeOffset value, bool emptyIsMin) | |
Creates a new SmartDate object. More... | |
SmartDate (DateTimeOffset value, EmptyValue emptyValue) | |
Creates a new SmartDate object. More... | |
SmartDate (string value) | |
Creates a new SmartDate object. More... | |
SmartDate (string value, bool emptyIsMin) | |
Creates a new SmartDate object. More... | |
SmartDate (string value, EmptyValue emptyValue) | |
Creates a new SmartDate object. More... | |
DateTimeOffset | ToDateTimeOffset () |
Gets the value as a DateTimeOffset. More... | |
DateTime? | ToNullableDate () |
Gets the value as a DateTime?. More... | |
override string | ToString () |
Returns a text representation of the date value. More... | |
string | ToString (string format) |
Returns a text representation of the date value. More... | |
override bool | Equals (object obj) |
Compares this object to another SmartDate for equality. More... | |
override int | GetHashCode () |
Returns a hash code for this object. More... | |
int | CompareTo (SmartDate value) |
Compares one SmartDate to another. More... | |
int IComparable. | CompareTo (object value) |
Compares one SmartDate to another. More... | |
int | CompareTo (string value) |
Compares a SmartDate to a text date value. More... | |
int | CompareTo (DateTimeOffset value) |
Compares a SmartDate to a date value. More... | |
int | CompareTo (DateTime value) |
Compares a SmartDate to a date value. More... | |
DateTime | Add (TimeSpan value) |
Adds a TimeSpan onto the object. More... | |
DateTime | Subtract (TimeSpan value) |
Subtracts a TimeSpan from the object. More... | |
TimeSpan | Subtract (DateTimeOffset value) |
Subtracts a DateTimeOffset from the object. More... | |
TimeSpan | Subtract (DateTime value) |
Subtracts a DateTime from the object. More... | |
System.TypeCode IConvertible. | GetTypeCode () |
bool IConvertible. | ToBoolean (System.IFormatProvider provider) |
byte IConvertible. | ToByte (System.IFormatProvider provider) |
char IConvertible. | ToChar (System.IFormatProvider provider) |
System.DateTime IConvertible. | ToDateTime (System.IFormatProvider provider) |
decimal IConvertible. | ToDecimal (System.IFormatProvider provider) |
double IConvertible. | ToDouble (System.IFormatProvider provider) |
short IConvertible. | ToInt16 (System.IFormatProvider provider) |
int IConvertible. | ToInt32 (System.IFormatProvider provider) |
long IConvertible. | ToInt64 (System.IFormatProvider provider) |
sbyte IConvertible. | ToSByte (System.IFormatProvider provider) |
float IConvertible. | ToSingle (System.IFormatProvider provider) |
string IConvertible. | ToString (System.IFormatProvider provider) |
object IConvertible. | ToType (System.Type conversionType, System.IFormatProvider provider) |
ushort IConvertible. | ToUInt16 (System.IFormatProvider provider) |
uint IConvertible. | ToUInt32 (System.IFormatProvider provider) |
ulong IConvertible. | ToUInt64 (System.IFormatProvider provider) |
string IFormattable. | ToString (string format, IFormatProvider formatProvider) |
void IMobileObject. | GetState (SerializationInfo info) |
Method called by MobileFormatter when an object should serialize its data. More... | |
void IMobileObject. | SetState (SerializationInfo info) |
Method called by MobileFormatter when an object should be deserialized. More... | |
void IMobileObject. | SetChildren (SerializationInfo info, MobileFormatter formatter) |
Method called by MobileFormatter when an object should deserialize its child references. More... | |
void IMobileObject. | GetChildren (SerializationInfo info, MobileFormatter formatter) |
Method called by MobileFormatter when an object should serialize its child references. More... | |
Static Public Member Functions | |
static | SmartDate () |
static void | SetDefaultFormatString (string formatString) |
Sets the global default format string used by all new SmartDate values going forward. More... | |
static SmartDate | Parse (string value) |
Converts a string value into a SmartDate. More... | |
static SmartDate | Parse (string value, EmptyValue emptyValue) |
Converts a string value into a SmartDate. More... | |
static SmartDate | Parse (string value, bool emptyIsMin) |
Converts a string value into a SmartDate. More... | |
static bool | TryParse (string value, ref SmartDate result) |
Converts a string value into a SmartDate. More... | |
static bool | TryParse (string value, EmptyValue emptyValue, ref SmartDate result) |
Converts a string value into a SmartDate. More... | |
static DateTime | StringToDate (string value) |
Converts a text date representation into a Date value. More... | |
static DateTime | StringToDate (string value, bool emptyIsMin) |
static DateTime | StringToDate (string value, EmptyValue emptyValue) |
Converts a text date representation into a Date value. More... | |
static string | DateToString (DateTime value, string formatString) |
Converts a date value into a text representation. More... | |
static string | DateToString (DateTime value, string formatString, bool emptyIsMin) |
Converts a date value into a text representation. More... | |
static string | DateToString (DateTime value, string formatString, EmptyValue emptyValue) |
Converts a date value into a text representation. More... | |
static bool | operator== (SmartDate obj1, SmartDate obj2) |
Equality operator More... | |
static bool | operator!= (SmartDate obj1, SmartDate obj2) |
Inequality operator More... | |
static implicit | operator string (SmartDate obj1) |
Convert a SmartDate to a String. More... | |
static implicit | operator System.DateTime (SmartDate obj1) |
Convert a SmartDate to a DateTime. More... | |
static implicit | operator System.DateTime? (SmartDate obj1) |
Convert a SmartDate to a nullable DateTime. More... | |
static implicit | operator DateTimeOffset (SmartDate obj1) |
Convert a SmartDate to a DateTimeOffset. More... | |
static | operator SmartDate (string dateValue) |
Convert a value to a SmartDate. More... | |
static implicit | operator SmartDate (System.DateTime dateValue) |
Convert a value to a SmartDate. More... | |
static implicit | operator SmartDate (System.DateTime? dateValue) |
Convert a value to a SmartDate. More... | |
static | operator SmartDate (DateTimeOffset dateValue) |
Convert a value to a SmartDate. More... | |
static bool | operator== (SmartDate obj1, DateTime obj2) |
Equality operator More... | |
static bool | operator!= (SmartDate obj1, DateTime obj2) |
Inequality operator More... | |
static bool | operator== (SmartDate obj1, string obj2) |
Equality operator More... | |
static bool | operator!= (SmartDate obj1, string obj2) |
Inequality operator More... | |
static SmartDate | operator+ (SmartDate start, TimeSpan span) |
Addition operator More... | |
static SmartDate | operator- (SmartDate start, TimeSpan span) |
Subtraction operator More... | |
static TimeSpan | operator- (SmartDate start, SmartDate finish) |
Subtraction operator More... | |
static bool | operator> (SmartDate obj1, SmartDate obj2) |
Greater than operator More... | |
static bool | operator< (SmartDate obj1, SmartDate obj2) |
Less than operator More... | |
static bool | operator> (SmartDate obj1, DateTime obj2) |
Greater than operator More... | |
static bool | operator< (SmartDate obj1, DateTime obj2) |
Less than operator More... | |
static bool | operator> (SmartDate obj1, string obj2) |
Greater than operator More... | |
static bool | operator< (SmartDate obj1, string obj2) |
Less than operator More... | |
static bool | operator>= (SmartDate obj1, SmartDate obj2) |
Greater than or equals operator More... | |
static bool | operator<= (SmartDate obj1, SmartDate obj2) |
Less than or equals operator More... | |
static bool | operator>= (SmartDate obj1, DateTime obj2) |
Greater than or equals operator More... | |
static bool | operator<= (SmartDate obj1, DateTime obj2) |
Less than or equals operator More... | |
static bool | operator>= (SmartDate obj1, string obj2) |
Greater than or equals operator More... | |
static bool | operator<= (SmartDate obj1, string obj2) |
Less than or equals operator More... | |
Properties | |
string | FormatString [getset] |
Gets or sets the format string used to format a date value when it is returned as text. More... | |
string | Text [getset] |
Gets or sets the date value. More... | |
DateTime? | Date [getset] |
Gets or sets the date value. More... | |
object | DBValue [get] |
Gets a database-friendly version of the date value. More... | |
bool | IsEmpty [get] |
Gets a value indicating whether this object contains an empty date. More... | |
bool | EmptyIsMin [get] |
Gets a value indicating whether an empty date is the min or max possible date value. More... | |
static Func< string, DateTime?> | CustomParser [getset] |
Gets or sets the custom parser. More... | |
Properties inherited from Csla.Core.ISmartField | |
string | Text [getset] |
Sets or gets the text representation of the value. More... | |
bool | IsEmpty [get] |
Gets a value indicating whether the field's value is empty. More... | |
Provides a date data type that understands the concept of an empty date value.
See Chapter 5 for a full discussion of the need for this data type and the design choices behind it.
Definition at line 27 of file SmartDate.cs.
Indicates the empty value of a SmartDate.
Enumerator | |
---|---|
MinDate | Indicates that an empty SmartDate is the smallest date. |
MaxDate | Indicates that an empty SmartDate is the largest date. |
Definition at line 51 of file SmartDate.cs.
|
static |
Definition at line 69 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | bool | emptyIsMin | ) |
Creates a new SmartDate object.
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 78 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | EmptyValue | emptyValue | ) |
Creates a new SmartDate object.
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 92 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime | value | ) |
Creates a new SmartDate object.
The SmartDate created will use the min possible date to represent an empty date.
value | The initial value of the object. |
Definition at line 110 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime | value, |
bool | emptyIsMin | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 124 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime | value, |
EmptyValue | emptyValue | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 138 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime | value, |
EmptyValue | emptyValue, | ||
DateTimeKind | kind | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyValue | Indicates whether an empty date is the min or max date value. |
kind | One of the DateTimeKind values. |
Definition at line 153 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime? | value | ) |
Creates a new SmartDate object.
The SmartDate created will use the min possible date to represent an empty date.
value | The initial value of the object. |
Definition at line 170 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime? | value, |
bool | emptyIsMin | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 185 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTime? | value, |
EmptyValue | emptyValue | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 200 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTimeOffset | value | ) |
Creates a new SmartDate object.
The SmartDate created will use the min possible date to represent an empty date.
SmartDate maintains the date value as a DateTime, so the provided DateTimeOffset is converted to a DateTime in this constructor. You should be aware that this can lead to a loss of precision in some cases.
value | The initial value of the object. |
Definition at line 226 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTimeOffset | value, |
bool | emptyIsMin | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
SmartDate maintains the date value as a DateTime, so the provided DateTimeOffset is converted to a DateTime in this constructor. You should be aware that this can lead to a loss of precision in some cases.
Definition at line 247 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | DateTimeOffset | value, |
EmptyValue | emptyValue | ||
) |
Creates a new SmartDate object.
value | The initial value of the object. |
emptyValue | Indicates whether an empty date is the min or max date value. |
SmartDate maintains the date value as a DateTime, so the provided DateTimeOffset is converted to a DateTime in this constructor. You should be aware that this can lead to a loss of precision in some cases.
Definition at line 268 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | string | value | ) |
Creates a new SmartDate object.
The SmartDate created will use the min possible date to represent an empty date.
value | The initial value of the object (as text). |
Definition at line 285 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | string | value, |
bool | emptyIsMin | ||
) |
Creates a new SmartDate object.
value | The initial value of the object (as text). |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 299 of file SmartDate.cs.
Csla.SmartDate.SmartDate | ( | string | value, |
EmptyValue | emptyValue | ||
) |
Creates a new SmartDate object.
value | The initial value of the object (as text). |
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 313 of file SmartDate.cs.
DateTime Csla.SmartDate.Add | ( | TimeSpan | value | ) |
Adds a TimeSpan onto the object.
value | Span to add to the date. |
Definition at line 910 of file SmartDate.cs.
int Csla.SmartDate.CompareTo | ( | DateTime | value | ) |
Compares a SmartDate to a date value.
value | The date to which we are being compared. |
Definition at line 901 of file SmartDate.cs.
int Csla.SmartDate.CompareTo | ( | DateTimeOffset | value | ) |
Compares a SmartDate to a date value.
value | The date to which we are being compared. |
SmartDate maintains the date value as a DateTime, so the provided DateTimeOffset is converted to a DateTime for this comparison. You should be aware that this can lead to a loss of precision in some cases.
Definition at line 891 of file SmartDate.cs.
int IComparable. Csla.SmartDate.CompareTo | ( | object | value | ) |
Compares one SmartDate to another.
This method works the same as the DateTime.CompareTo method on the Date datetype, with the exception that it understands the concept of empty date values.
value | The date to which we are being compared. |
Definition at line 861 of file SmartDate.cs.
int Csla.SmartDate.CompareTo | ( | SmartDate | value | ) |
Compares one SmartDate to another.
This method works the same as the DateTime.CompareTo method on the Date datetype, with the exception that it understands the concept of empty date values.
value | The date to which we are being compared. |
Definition at line 843 of file SmartDate.cs.
int Csla.SmartDate.CompareTo | ( | string | value | ) |
Compares a SmartDate to a text date value.
value | The date to which we are being compared. |
Definition at line 874 of file SmartDate.cs.
|
static |
Converts a date value into a text representation.
The date is considered empty if it matches the min value for the Date datatype. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter.
value | The date value to convert. |
formatString | The format string used to format the date into text. |
Definition at line 775 of file SmartDate.cs.
|
static |
Converts a date value into a text representation.
Whether the date value is considered empty is determined by the EmptyIsMin parameter value. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter.
value | The date value to convert. |
formatString | The format string used to format the date into text. |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 794 of file SmartDate.cs.
|
static |
Converts a date value into a text representation.
Whether the date value is considered empty is determined by the EmptyIsMin parameter value. If the date is empty, this method returns an empty string. Otherwise it returns the date value formatted based on the FormatString parameter.
value | The date value to convert. |
formatString | The format string used to format the date into text. |
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 813 of file SmartDate.cs.
override bool Csla.SmartDate.Equals | ( | object | obj | ) |
Compares this object to another SmartDate for equality.
obj | Object to compare for equality. |
Definition at line 480 of file SmartDate.cs.
void IMobileObject. Csla.SmartDate.GetChildren | ( | SerializationInfo | info, |
MobileFormatter | formatter | ||
) |
Method called by MobileFormatter when an object should serialize its child references.
The data should be serialized into the SerializationInfo parameter.
info | Object to contain the serialized data. |
formatter | Reference to the formatter performing the serialization. |
Implements Csla.Serialization.Mobile.IMobileObject.
Definition at line 1401 of file SmartDate.cs.
override int Csla.SmartDate.GetHashCode | ( | ) |
Returns a hash code for this object.
Definition at line 501 of file SmartDate.cs.
void IMobileObject. Csla.SmartDate.GetState | ( | SerializationInfo | info | ) |
Method called by MobileFormatter when an object should serialize its data.
The data should be serialized into the SerializationInfo parameter.
info | Object to contain the serialized data. |
Implements Csla.Serialization.Mobile.IMobileObject.
Definition at line 1378 of file SmartDate.cs.
System.TypeCode IConvertible. Csla.SmartDate.GetTypeCode | ( | ) |
Definition at line 1273 of file SmartDate.cs.
|
static |
Convert a SmartDate to a DateTimeOffset.
obj1 | SmartDate value. |
Definition at line 1018 of file SmartDate.cs.
|
explicitstatic |
Convert a value to a SmartDate.
dateValue | Value to convert. |
Definition at line 1054 of file SmartDate.cs.
|
explicitstatic |
Convert a value to a SmartDate.
dateValue | Value to convert. |
Definition at line 1027 of file SmartDate.cs.
|
static |
Convert a value to a SmartDate.
dateValue | Value to convert. |
Definition at line 1036 of file SmartDate.cs.
|
static |
Convert a value to a SmartDate.
dateValue | Value to convert. |
Definition at line 1045 of file SmartDate.cs.
|
static |
Convert a SmartDate to a String.
obj1 | SmartDate value. |
Definition at line 991 of file SmartDate.cs.
|
static |
Convert a SmartDate to a DateTime.
obj1 | SmartDate value. |
Definition at line 1000 of file SmartDate.cs.
|
static |
Convert a SmartDate to a nullable DateTime.
obj1 | SmartDate value. |
Definition at line 1009 of file SmartDate.cs.
|
static |
Inequality operator
obj1 | First object |
obj2 | Second object |
Definition at line 1076 of file SmartDate.cs.
Inequality operator
obj1 | First object |
obj2 | Second object |
Definition at line 982 of file SmartDate.cs.
|
static |
Inequality operator
obj1 | First object |
obj2 | Second object |
Definition at line 1098 of file SmartDate.cs.
Addition operator
start | Original date/time |
span | Span to add |
Definition at line 1109 of file SmartDate.cs.
Subtraction operator
start | Original date/time |
finish | Second date/time |
Definition at line 1131 of file SmartDate.cs.
Subtraction operator
start | Original date/time |
span | Span to subtract |
Definition at line 1120 of file SmartDate.cs.
|
static |
Less than operator
obj1 | First object |
obj2 | Second object |
Definition at line 1175 of file SmartDate.cs.
Less than operator
obj1 | First object |
obj2 | Second object |
Definition at line 1153 of file SmartDate.cs.
|
static |
Less than operator
obj1 | First object |
obj2 | Second object |
Definition at line 1197 of file SmartDate.cs.
|
static |
Less than or equals operator
obj1 | First object |
obj2 | Second object |
Definition at line 1241 of file SmartDate.cs.
Less than or equals operator
obj1 | First object |
obj2 | Second object |
Definition at line 1219 of file SmartDate.cs.
|
static |
Less than or equals operator
obj1 | First object |
obj2 | Second object |
Definition at line 1263 of file SmartDate.cs.
|
static |
Equality operator
obj1 | First object |
obj2 | Second object |
Definition at line 1065 of file SmartDate.cs.
Equality operator
obj1 | First object |
obj2 | Second object |
Definition at line 971 of file SmartDate.cs.
|
static |
Equality operator
obj1 | First object |
obj2 | Second object |
Definition at line 1087 of file SmartDate.cs.
|
static |
Greater than operator
obj1 | First object |
obj2 | Second object |
Definition at line 1164 of file SmartDate.cs.
Greater than operator
obj1 | First object |
obj2 | Second object |
Definition at line 1142 of file SmartDate.cs.
|
static |
Greater than operator
obj1 | First object |
obj2 | Second object |
Definition at line 1186 of file SmartDate.cs.
|
static |
Greater than or equals operator
obj1 | First object |
obj2 | Second object |
Definition at line 1230 of file SmartDate.cs.
Greater than or equals operator
obj1 | First object |
obj2 | Second object |
Definition at line 1208 of file SmartDate.cs.
|
static |
Greater than or equals operator
obj1 | First object |
obj2 | Second object |
Definition at line 1252 of file SmartDate.cs.
|
static |
Converts a string value into a SmartDate.
value | String containing the date value. |
EmptyIsMin will default to true.
Definition at line 600 of file SmartDate.cs.
|
static |
Converts a string value into a SmartDate.
value | String containing the date value. |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 622 of file SmartDate.cs.
|
static |
Converts a string value into a SmartDate.
value | String containing the date value. |
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 611 of file SmartDate.cs.
void IMobileObject. Csla.SmartDate.SetChildren | ( | SerializationInfo | info, |
MobileFormatter | formatter | ||
) |
Method called by MobileFormatter when an object should deserialize its child references.
The data should be deserialized from the SerializationInfo parameter.
info | Object containing the serialized data. |
formatter | Reference to the formatter performing the deserialization. |
Implements Csla.Serialization.Mobile.IMobileObject.
Definition at line 1396 of file SmartDate.cs.
|
static |
Sets the global default format string used by all new SmartDate values going forward.
The default global format string is "d" unless this method is called to change that value. Existing SmartDate values are unaffected by this method, only SmartDate values created after calling this method are affected.
formatString | The format string should follow the requirements for the .NET System.String.Format statement. |
Definition at line 356 of file SmartDate.cs.
void IMobileObject. Csla.SmartDate.SetState | ( | SerializationInfo | info | ) |
Method called by MobileFormatter when an object should be deserialized.
The data should be deserialized from the SerializationInfo parameter.
info | Object containing the serialized data. |
Implements Csla.Serialization.Mobile.IMobileObject.
Definition at line 1387 of file SmartDate.cs.
|
static |
Converts a text date representation into a Date value.
An empty string is assumed to represent an empty date. An empty date is returned as the MinValue of the Date datatype.
value | The text representation of the date. |
Definition at line 668 of file SmartDate.cs.
|
static |
Converts a text date representation into a Date value.
An empty string is assumed to represent an empty date. An empty date is returned as the MinValue or MaxValue of the Date datatype depending on the EmptyIsMin parameter.
value | The text representation of the date. |
emptyIsMin | Indicates whether an empty date is the min or max date value. |
Definition at line 684 of file SmartDate.cs.
|
static |
Converts a text date representation into a Date value.
An empty string is assumed to represent an empty date. An empty date is returned as the MinValue or MaxValue of the Date datatype depending on the EmptyIsMin parameter.
value | The text representation of the date. |
emptyValue | Indicates whether an empty date is the min or max date value. |
Definition at line 700 of file SmartDate.cs.
TimeSpan Csla.SmartDate.Subtract | ( | DateTime | value | ) |
Subtracts a DateTime from the object.
value | Date to subtract from the date. |
Definition at line 953 of file SmartDate.cs.
TimeSpan Csla.SmartDate.Subtract | ( | DateTimeOffset | value | ) |
Subtracts a DateTimeOffset from the object.
value | DateTimeOffset to subtract from the date. |
SmartDate maintains the date value as a DateTime, so the provided DateTimeOffset is converted to a DateTime for this comparison. You should be aware that this can lead to a loss of precision in some cases.
Definition at line 941 of file SmartDate.cs.
DateTime Csla.SmartDate.Subtract | ( | TimeSpan | value | ) |
Subtracts a TimeSpan from the object.
value | Span to subtract from the date. |
Definition at line 922 of file SmartDate.cs.
bool IConvertible. Csla.SmartDate.ToBoolean | ( | System.IFormatProvider | provider | ) |
Definition at line 1278 of file SmartDate.cs.
byte IConvertible. Csla.SmartDate.ToByte | ( | System.IFormatProvider | provider | ) |
Definition at line 1283 of file SmartDate.cs.
char IConvertible. Csla.SmartDate.ToChar | ( | System.IFormatProvider | provider | ) |
Definition at line 1288 of file SmartDate.cs.
System.DateTime IConvertible. Csla.SmartDate.ToDateTime | ( | System.IFormatProvider | provider | ) |
Definition at line 1293 of file SmartDate.cs.
DateTimeOffset Csla.SmartDate.ToDateTimeOffset | ( | ) |
Gets the value as a DateTimeOffset.
Definition at line 433 of file SmartDate.cs.
decimal IConvertible. Csla.SmartDate.ToDecimal | ( | System.IFormatProvider | provider | ) |
Definition at line 1298 of file SmartDate.cs.
double IConvertible. Csla.SmartDate.ToDouble | ( | System.IFormatProvider | provider | ) |
Definition at line 1303 of file SmartDate.cs.
short IConvertible. Csla.SmartDate.ToInt16 | ( | System.IFormatProvider | provider | ) |
Definition at line 1308 of file SmartDate.cs.
int IConvertible. Csla.SmartDate.ToInt32 | ( | System.IFormatProvider | provider | ) |
Definition at line 1313 of file SmartDate.cs.
long IConvertible. Csla.SmartDate.ToInt64 | ( | System.IFormatProvider | provider | ) |
Definition at line 1318 of file SmartDate.cs.
DateTime? Csla.SmartDate.ToNullableDate | ( | ) |
Gets the value as a DateTime?.
Definition at line 441 of file SmartDate.cs.
sbyte IConvertible. Csla.SmartDate.ToSByte | ( | System.IFormatProvider | provider | ) |
Definition at line 1323 of file SmartDate.cs.
float IConvertible. Csla.SmartDate.ToSingle | ( | System.IFormatProvider | provider | ) |
Definition at line 1328 of file SmartDate.cs.
override string Csla.SmartDate.ToString | ( | ) |
Returns a text representation of the date value.
Definition at line 456 of file SmartDate.cs.
string Csla.SmartDate.ToString | ( | string | format | ) |
Returns a text representation of the date value.
format | A standard .NET format string. |
Definition at line 467 of file SmartDate.cs.
string IFormattable. Csla.SmartDate.ToString | ( | string | format, |
IFormatProvider | formatProvider | ||
) |
Definition at line 1369 of file SmartDate.cs.
string IConvertible. Csla.SmartDate.ToString | ( | System.IFormatProvider | provider | ) |
Definition at line 1333 of file SmartDate.cs.
object IConvertible. Csla.SmartDate.ToType | ( | System.Type | conversionType, |
System.IFormatProvider | provider | ||
) |
Definition at line 1338 of file SmartDate.cs.
ushort IConvertible. Csla.SmartDate.ToUInt16 | ( | System.IFormatProvider | provider | ) |
Definition at line 1348 of file SmartDate.cs.
uint IConvertible. Csla.SmartDate.ToUInt32 | ( | System.IFormatProvider | provider | ) |
Definition at line 1353 of file SmartDate.cs.
ulong IConvertible. Csla.SmartDate.ToUInt64 | ( | System.IFormatProvider | provider | ) |
Definition at line 1358 of file SmartDate.cs.
|
static |
Converts a string value into a SmartDate.
value | String containing the date value. |
emptyValue | Indicates whether an empty date is the min or max date value. |
result | The resulting SmartDate value if the parse was successful. |
Definition at line 645 of file SmartDate.cs.
|
static |
Converts a string value into a SmartDate.
value | String containing the date value. |
result | The resulting SmartDate value if the parse was successful. |
Definition at line 633 of file SmartDate.cs.
|
staticgetset |
Gets or sets the custom parser.
The CustomParser is called first in TryStringToDate to allow custom parsing. The parser method must return null if unable to parse and allow SmartDate to try default parsing.
The custom parser.
Definition at line 585 of file SmartDate.cs.
|
getset |
Gets or sets the date value.
Definition at line 412 of file SmartDate.cs.
|
get |
Gets a database-friendly version of the date value.
If the SmartDate contains an empty date, this returns DBNull. Otherwise the actual date value is returned as type Date.
This property is very useful when setting parameter values for a Command object, since it automatically stores null values into the database for empty date values.
When you also use the SafeDataReader and its GetSmartDate method, you can easily read a null value from the database back into a SmartDate object so it remains considered as an empty date value.
Definition at line 528 of file SmartDate.cs.
|
get |
Gets a value indicating whether an empty date is the min or max possible date value.
Whether an empty date is considered to be the smallest or largest possible date is only important for comparison operations. This allows you to compare an empty date with a real date and get a meaningful result.
Definition at line 567 of file SmartDate.cs.
|
getset |
Gets or sets the format string used to format a date value when it is returned as text.
The format string should follow the requirements for the .NET System.String.Format statement.
A format string.
Definition at line 370 of file SmartDate.cs.
|
get |
Gets a value indicating whether this object contains an empty date.
Definition at line 547 of file SmartDate.cs.
|
getset |
Gets or sets the date value.
This property can be used to set the date value by passing a text representation of the date. Any text date representation that can be parsed by the .NET runtime is valid.
When the date value is retrieved via this property, the text is formatted by using the format specified by the FormatString property. The default is the short date format (d).
Definition at line 399 of file SmartDate.cs.