Class ConditionExtensions
This is an extension implementation of the most common methods on the Condition class.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class ConditionExtensions
Methods
| Improve this DocIsEmailAddress(String)
Determines whether the specified value has a valid format of an email address.
Declaration
public static bool IsEmailAddress(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to verify has a valid format of an email address. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsGuid(String)
Determines whether the specified value has a valid format of a System.Guid.
Declaration
public static bool IsGuid(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to verify has a valid format of a System.Guid. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
This implementation only evaluates for GUID formats of: DigitFormat | BraceFormat | ParenthesisFormat, eg. 32 digits separated by hyphens; 32 digits separated by hyphens, enclosed in brackets and 32 digits separated by hyphens, enclosed in parentheses.
The reason not to include NumberFormat, eg. 32 digits is the possible unintended GUID result of a MD5 string representation.
IsGuid(String, GuidFormats)
Determines whether the specified value has a valid format of a System.Guid.
Declaration
public static bool IsGuid(this string value, GuidFormats format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to verify has a valid format of a System.Guid. |
| GuidFormats | format | A bitmask comprised of one or more GuidFormats that specify how the GUID parsing is conducted. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsHex(String)
Determines whether the specified value is hexadecimal.
Declaration
public static bool IsHex(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to verify is hexadecimal. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsNumeric(String)
Determines whether the specified value can be evaluated as a number.
Declaration
public static bool IsNumeric(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value to be evaluated. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
This method implements a default permitted format of value as System.Globalization.NumberStyles.Number.
This method implements a default culture-specific formatting information about value specified to System.Globalization.CultureInfo.InvariantCulture.
IsNumeric(String, NumberStyles)
Determines whether the specified value can be evaluated as a number.
Declaration
public static bool IsNumeric(this string value, NumberStyles style)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value to be evaluated. |
| System.Globalization.NumberStyles | style | A bitwise combination of System.Globalization.NumberStyles values that indicates the permitted format of |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
This method implements a default culture-specific formatting information about value specified to System.Globalization.CultureInfo.InvariantCulture.
IsNumeric(String, NumberStyles, IFormatProvider)
Determines whether the specified value can be evaluated as a number.
Declaration
public static bool IsNumeric(this string value, NumberStyles style, IFormatProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The value to be evaluated. |
| System.Globalization.NumberStyles | style | A bitwise combination of System.Globalization.NumberStyles values that indicates the permitted format of |
| System.IFormatProvider | provider | An System.IFormatProvider that supplies culture-specific formatting information about |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|