Xomega Framework includes several data properties for standard data types, as described below.
Below are some general data properties included with the Xomega Framework.
TextProperty class stores its value as a
string, and converts any value to a string using the
If you set the
Size of your text property to any positive number, then it will validate that the length of the stored string is no longer than the specified size.
BooleanProperty class stores its value as a
bool? to allow storing
null values. It can convert the input string to a boolean using various formats, e.g. "true", "1" or "yes" for the
true value, and the "false", "0" or "no" for the
You can customize the list of strings that represent
false values by setting the corresponding static arrays
The property value will be always displayed as a string as either "true" or "false" using the
GuidProperty class stores its value as a
Guid? to allow storing
null values. It parses the input string as a
Guid using the standard
Guid.TryParse method, and displays it as a string using the standard
All integer properties in Xomega Framework store their value as a nullable of one of the integer types, as described below.
BigIntegerProperty class validates that the stored value is a
long? between the
PositiveBigIntProperty class validates that the stored value is between
IntegerProperty class validates that the stored value is an
int? between the
PositiveIntegerProperty class validates that the stored value is between
SmallIntegerProperty class validates that the stored value is a
short? between the
PositiveSmallIntProperty class validates that the stored value is between
TinyIntegerProperty class validates that the stored value is a
byte? between the
Integer key properties
Xomega Framework defines the following set of marker subclasses of the corresponding integer property that indicate that its value is used as a key of an entity, as opposed to just a regular properties.
BigIntegerKeyProperty- a key property of underlying type
IntegerKeyProperty- a key property of underlying type
SmallIntegerKeyProperty- a key property of underlying type
TinyIntegerKeyProperty- a key property of underlying type
This allows treating such properties differently in certain scenarios. For example, when adding search criteria by a field that contains integer keys, the corresponding
OperatorProperty will include only equality operators, but not the comparison operators, such as "Less Than" or "Greater Than".
All decimal properties in Xomega Framework store their value as a
decimal?, but may provide some restrictions on the minimum and maximum values, or format the value in a certain way, as described below.
DecimalProperty class validates that the stored value is between the
decimal.MaxValue, but you can set your custom
MaximumValue. You can also set the
MaximumAllowed flags on the property to indicate whether the
MaximumValue are valid values.
The decimal value can be parsed from a string using the
NumberStyles.Number formats, but you can set the
ParseStyles on the property to your custom styles.
It will use the
ToString method to show the value as a string, but you can also set a custom
DisplayFormat to show it as a
DisplayString using the specified format (but not as an
PositiveDecimalProperty class validates that the stored value is between the
decimal.MaxValue. You can also set the
false for truly positive numbers greater than 0.
MoneyProperty is a decimal property that displays its value in a currency format for the current culture. It also parses the input string using the
PositiveMoneyProperty is a money property that validates that the stored amount is not negative. You can also set the
false for truly positive amounts greater than 0.
PercentProperty is a decimal property that displays its value in a percent format for the current culture.
PercentFractionProperty ensures that its value is between 0 and 1, meaning that it cannot be more than 100%.
All date/time properties in Xomega Framework store their value as a
DateTime?, but may format the value in a certain way, as described below.
DateTimeProperty parses the input string using the standard
DateTime.TryParse method, and displays the value as a string using a space-delimited
ShortTimePattern of the
DateTimeFormatInfo.CurrentInfo. You can specify a custom display format by setting its
Format member though. The property will check that its value is a
DateTime during validation.
DateProperty is a date/time property that formats its string value using
TimeProperty is a date/time property that formats its string value using
It can also parse the time of day from a single number, e.g. using a military format such as "1500".
You can set the
MinutesCentric property to
true to treat a number less than 24 as minutes. In this case, for example, "15" would be parsed as "00:15" rather than as "15:00".