Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Extensions.IntExtensions Class Reference

Any int extension methods More...

Static Public Member Functions

static T ToEnum< T > (this int val)
 Casts an int to an enum More...
 
static T ToEnum< T > (this int val, T defaultValue)
 Casts a string to an enum More...
 
static bool Between (this int val, int val1, int val2, bool includeLowerValue=true, bool includeUpperValue=true)
 Determines if a More...
 
static string ToMonthName (this int val, bool useAbbreviation=true)
 Takes the month number and converts it to the name of the month More...
 
static string ToQuarterName (this int val)
 Takes the quarter number and converts it to the name of the quarter More...
 
static string ToMonthYearName (this int val)
 Takes the number corresponding to a month and year and converts it to the name More...
 
static string ToQuarterYearName (this int val)
 Takes the number corresponding to a quarter and year and converts it to the name More...
 

Detailed Description

Any int extension methods

Member Function Documentation

◆ Between()

static bool Sphyrnidae.Common.Extensions.IntExtensions.Between ( this int  val,
int  val1,
int  val2,
bool  includeLowerValue = true,
bool  includeUpperValue = true 
)
static

Determines if a

Parameters
valThe value being checked
val1The lower limit
val2The upper limit
includeLowerValueIf true (default), then if the value == the lower value, this will return true
includeUpperValueIf true (default), then if the value == the upper value, this will return true
Returns

◆ ToEnum< T >() [1/2]

static T Sphyrnidae.Common.Extensions.IntExtensions.ToEnum< T > ( this int  val)
static

Casts an int to an enum

Template Parameters
TAn enumeration
Parameters
valThe value of the enumeration to check
Returns
The enumeration value
Type Constraints
T :struct 
T :IConvertible 

◆ ToEnum< T >() [2/2]

static T Sphyrnidae.Common.Extensions.IntExtensions.ToEnum< T > ( this int  val,
defaultValue 
)
static

Casts a string to an enum

Template Parameters
TAn enumeration
Parameters
valThe value of the enumeration to check
defaultValueIf can not find a match, this will be returned
Returns
The enumeration value
Type Constraints
T :struct 
T :IConvertible 

◆ ToMonthName()

static string Sphyrnidae.Common.Extensions.IntExtensions.ToMonthName ( this int  val,
bool  useAbbreviation = true 
)
static

Takes the month number and converts it to the name of the month

Parameters
valThe value of the month (1-12)
useAbbreviationIf true (default), this will return the abbreviated month name instead of the full month
Returns
The month name

◆ ToMonthYearName()

static string Sphyrnidae.Common.Extensions.IntExtensions.ToMonthYearName ( this int  val)
static

Takes the number corresponding to a month and year and converts it to the name

Parameters
valThe value of the month and year. Format is YYYYMM
Returns
The month and year name

◆ ToQuarterName()

static string Sphyrnidae.Common.Extensions.IntExtensions.ToQuarterName ( this int  val)
static

Takes the quarter number and converts it to the name of the quarter

Parameters
valThe value of the quarter (1-4)
Returns
The quarter name

◆ ToQuarterYearName()

static string Sphyrnidae.Common.Extensions.IntExtensions.ToQuarterYearName ( this int  val)
static

Takes the number corresponding to a quarter and year and converts it to the name

Parameters
valThe value of the quarter and year. Format is YYYYQQ
Returns
The quarter and year name

The documentation for this class was generated from the following file: