Show / Hide Table of Contents

Class IComparableTEx

Class containing some extension methods for System.IComparable`1.

Inheritance
System.Object
IComparableTEx
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Extend
Assembly:Extend.dll
Syntax
public static class IComparableTEx

Methods

| Improve this Doc View Source

Between<T>(T, T, T)

Checks if the given value is between (exclusive) the minValue and maxValue.

Declaration
public static bool Between<T>(this T value, T minValue, T maxValue)where T : IComparable<T>
Parameters
Type Name Description
T value

The value to check.

T minValue

The minimum value.

T maxValue

The maximum value.

Returns
Type Description
System.Boolean

Returns true if the given value is between the minValue and maxValue, otherwise false.

Type Parameters
Name Description
T The type of the values to compare.
Exceptions
Type Condition
System.ArgumentNullException

The value can not be null.

System.ArgumentNullException

The min value can not be null.

System.ArgumentNullException

The max value can not be null.

| Improve this Doc View Source

BetweenInclusive<T>(T, T, T)

Checks if the given value is between (inclusive) the minValue and maxValue.

Declaration
public static bool BetweenInclusive<T>(this T value, T minValue, T maxValue)where T : IComparable<T>
Parameters
Type Name Description
T value

The value to check.

T minValue

The minimum value.

T maxValue

The maximum value.

Returns
Type Description
System.Boolean

Returns true if the given value is between the minValue and maxValue, otherwise false.

Type Parameters
Name Description
T The type of the values to compare.
Exceptions
Type Condition
System.ArgumentNullException

The value can not be null.

System.ArgumentNullException

The min value can not be null.

System.ArgumentNullException

The max value can not be null.

| Improve this Doc View Source

Greater<T>(T, T)

Checks if the value is greater than the given compare value.

Declaration
public static bool Greater<T>(this T value, T compareValue)where T : IComparable<T>
Parameters
Type Name Description
T value

The value to check.

T compareValue

The value to compare with.

Returns
Type Description
System.Boolean

Returns true if the value is greater than the given compare value, otherwise false.

Type Parameters
Name Description
T
Exceptions
Type Condition
System.ArgumentNullException

The value can not be null.

System.ArgumentNullException

The compare value can not be null.

| Improve this Doc View Source

GreaterOrEquals<T>(T, T)

Checks if the value is greater or equals to the given compare value.

Declaration
public static bool GreaterOrEquals<T>(this T value, T compareValue)where T : IComparable<T>
Parameters
Type Name Description
T value

The value to check.

T compareValue

The value to compare with.

Returns
Type Description
System.Boolean

Returns true if the value is greater or equals to the given compare value, otherwise false.

Type Parameters
Name Description
T
Exceptions
Type Condition
System.ArgumentNullException

The value can not be null.

System.ArgumentNullException

The compare value can not be null.

| Improve this Doc View Source

Smaller<T>(T, T)

Checks if the value is smaller than the given compare value.

Declaration
public static bool Smaller<T>(this T value, T compareValue)where T : IComparable<T>
Parameters
Type Name Description
T value

The value to check.

T compareValue

The value to compare with.

Returns
Type Description
System.Boolean

Returns true if the value is smaller than the given compare value, otherwise false.

Type Parameters
Name Description
T
Exceptions
Type Condition
System.ArgumentNullException

The value can not be null.

System.ArgumentNullException

The compare value can not be null.

| Improve this Doc View Source

SmallerOrEquals<T>(T, T)

Checks if the value is smaller or equals to the given compare value.

Declaration
public static bool SmallerOrEquals<T>(this T value, T compareValue)where T : IComparable<T>
Parameters
Type Name Description
T value

The value to check.

T compareValue

The value to compare with.

Returns
Type Description
System.Boolean

Returns true if the value is smaller or equals to the given compare value, otherwise false.

Type Parameters
Name Description
T
Exceptions
Type Condition
System.ArgumentNullException

The value can not be null.

System.ArgumentNullException

The compare value can not be null.

  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 Microsoft
Generated by DocFX