Search Results for

    Show / Hide Table of Contents

    Class StandardFunctions

    All contexts that are used in the formula engine should inherit from this base class that provides a set of common functions that can be used simply in formulas

    Inheritance
    System.Object
    StandardFunctions
    FormulaFunctions
    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: LemonEdge.Utils
    Assembly: Utils.dll
    Syntax
    public class StandardFunctions

    Methods

    Abs(Double)

    Returns the absolute value of a given number

    Declaration
    public double Abs(double val)
    Parameters
    Type Name Description
    System.Double val

    The number to return the absolute value of

    Returns
    Type Description
    System.Double

    The absolute value of a given number

    And(Boolean, Boolean)

    Returns true if value a and value b are both true

    Declaration
    public bool And(bool a, bool b)
    Parameters
    Type Name Description
    System.Boolean a

    The first value to check if it holds true

    System.Boolean b

    The second value to check if it holds true

    Returns
    Type Description
    System.Boolean

    True if both value a and b hold true

    BeginningOfDay(DateTime)

    Returns the specified date with a time component set to the beginning of the day (00:00:00.1)

    Declaration
    public DateTime BeginningOfDay(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the start of the day for

    Returns
    Type Description
    System.DateTime

    The start of the day for the specified dt

    BeginningOfMonth(DateTime)

    Returns the date for the beginning of the month of a specified date

    Declaration
    public DateTime BeginningOfMonth(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the beginning of the month of

    Returns
    Type Description
    System.DateTime

    The date of the beginning of the month for the specified dt

    BeginningOfWeek(DateTime)

    Returns the date for the start of the week (with Monday as the start) for the specified date

    Declaration
    public DateTime BeginningOfWeek(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the start of the week for

    Returns
    Type Description
    System.DateTime

    The date of the start of the week for the specified dt

    BeginningOfYear(DateTime)

    Returns the date for the beginning of the year for the specified date

    Declaration
    public DateTime BeginningOfYear(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the beginning of the year for

    Returns
    Type Description
    System.DateTime

    The date of the beginning of the year for the specified dt

    Ceiling(Decimal)

    Returns the smallest integral value greater than or equal to the specified d value

    Declaration
    public decimal Ceiling(decimal d)
    Parameters
    Type Name Description
    System.Decimal d

    The value to return the ceiling operation of

    Returns
    Type Description
    System.Decimal

    The smallest integral value greater than or equal to d

    ChCR()

    Returns a carriage return

    Declaration
    public string ChCR()
    Returns
    Type Description
    System.String

    A carriage return

    ChCRLF()

    Returns a carriage return and line feed - essentially a new line

    Declaration
    public string ChCRLF()
    Returns
    Type Description
    System.String

    A new line

    ChLF()

    Returns a line feed

    Declaration
    public string ChLF()
    Returns
    Type Description
    System.String

    A line feed

    Chr(Int32)

    Returns the character associated with the specified character code

    Declaration
    public char Chr(int c)
    Parameters
    Type Name Description
    System.Int32 c

    The character code to return the character of

    Returns
    Type Description
    System.Char

    A character matching the supplied c character code

    Contains(String, String)

    Returns a value indicating if a specified string s2 exists within the string s1

    Declaration
    public bool Contains(string s1, string s2)
    Parameters
    Type Name Description
    System.String s1

    The string to see if any instances of s2 exist within it

    System.String s2

    The string to search for within s1

    Returns
    Type Description
    System.Boolean

    True if s2 exists within s1

    Cos(Double)

    Returns the cosine of the specified angle

    Declaration
    public double Cos(double v)
    Parameters
    Type Name Description
    System.Double v

    The angle to return the cosine of

    Returns
    Type Description
    System.Double

    The cosine of v

    Date(Int32, Int32, Int32)

    Returns a datetime representation of the given year, month, day

    Declaration
    public DateTime Date(int year, int month, int day)
    Parameters
    Type Name Description
    System.Int32 year

    The year for the date

    System.Int32 month

    The month for the date

    System.Int32 day

    The day of the date

    Returns
    Type Description
    System.DateTime

    A valid datetime of the given year, month, day

    DateAdd(DateTime, DateTime)

    Returns a new date created by taking the date component of the first datetime and combining it with the time component of the second date

    Declaration
    public DateTime DateAdd(DateTime dateValue, DateTime timeValue)
    Parameters
    Type Name Description
    System.DateTime dateValue

    The date value to have a time component added to it

    System.DateTime timeValue

    The time component to combine with the date component

    Returns
    Type Description
    System.DateTime

    A new date from combining the first date with the second time component

    DateAdd(DateTime, Decimal, Decimal, Decimal)

    Returns the specified date with the supplied years, months, days added to it

    Declaration
    public DateTime DateAdd(DateTime date, decimal years, decimal months, decimal days)
    Parameters
    Type Name Description
    System.DateTime date

    The date to add years, months and/or days to

    System.Decimal years

    The amount of years to add to the given date

    System.Decimal months

    The amount of months to add to the given date

    System.Decimal days

    The amount of days to add to the given date

    Returns
    Type Description
    System.DateTime

    A new date with the supplied years, months and days added to it

    DateAddWorkDays(DateTime, Decimal)

    Returns the specified date with the supplied work days added to it (excludes saturdays and sundays)

    Declaration
    public DateTime DateAddWorkDays(DateTime date, decimal days)
    Parameters
    Type Name Description
    System.DateTime date

    The date to add the specified work days to

    System.Decimal days

    The amount of work days (excluding sat/sun) to add to the specified date

    Returns
    Type Description
    System.DateTime

    A new date with the specified number of work days added to the original date

    Day(DateTime)

    Returns the day value of a given date

    Declaration
    public int Day(DateTime d)
    Parameters
    Type Name Description
    System.DateTime d

    The date to get the day value of

    Returns
    Type Description
    System.Int32

    The day of a given date

    DayDifference(DateTime, DateTime)

    Returns the number of days between any two given dates

    Declaration
    public decimal DayDifference(DateTime date1, DateTime date2)
    Parameters
    Type Name Description
    System.DateTime date1

    The first date to find the number of days difference with

    System.DateTime date2

    The second date to find the numbers of days difference with

    Returns
    Type Description
    System.Decimal

    The number of days between date1 and date2. If date2 is less than date1 the number will be negative

    DayDifferenceWorkDays(DateTime, DateTime)

    Returns the number of work days between any two given dates excluding saturdays and sundays from the calculation

    Declaration
    public decimal DayDifferenceWorkDays(DateTime date1, DateTime date2)
    Parameters
    Type Name Description
    System.DateTime date1

    The first date to find the number of work days difference with

    System.DateTime date2

    The second date to find the numbers of work days difference with

    Returns
    Type Description
    System.Decimal

    The number of work days (excludes saturdays and sundays) between date1 and date2. If date2 is less than date1 the number will be negative

    Dec(Object)

    Converts the specified value to a decimal representation

    Declaration
    public double Dec(object value)
    Parameters
    Type Name Description
    System.Object value

    The value to return in decimal form

    Returns
    Type Description
    System.Double

    A decimal representation of the supplied value

    EndOfDay(DateTime)

    Returns the specified date with a time component set to the end of the day (23:59:59.999)

    Declaration
    public DateTime EndOfDay(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the end of the day for

    Returns
    Type Description
    System.DateTime

    The end of the day for the specified dt

    EndOfMonth(DateTime)

    Returns the date for the end of the month of a specified date

    Declaration
    public DateTime EndOfMonth(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the end of the month of

    Returns
    Type Description
    System.DateTime

    The date of the end of the month for the specified dt

    EndOfYear(DateTime)

    Returns the date for the end of the year for the specified date

    Declaration
    public DateTime EndOfYear(DateTime dt)
    Parameters
    Type Name Description
    System.DateTime dt

    The date to return the end of the year for

    Returns
    Type Description
    System.DateTime

    The date of the end of the year for the specified dt

    Floor(Decimal)

    Returns the largest integral value less than or equal to the specified d value

    Declaration
    public decimal Floor(decimal d)
    Parameters
    Type Name Description
    System.Decimal d

    The value to return the floor operation of

    Returns
    Type Description
    System.Decimal

    The largest integral value less than or equal to d

    Format(Object, String)

    Formats the given value according to the specified format style

    Declaration
    public string Format(object value, string style)
    Parameters
    Type Name Description
    System.Object value

    The value to be formatted. Must be a decimal or datetime to apply formatting to.

    System.String style

    The formatting to be applied when returning the value as a string

    Returns
    Type Description
    System.String

    The specified value as a string using the provided formattingstyle

    FormatAsString(Object)

    Declaration
    protected string FormatAsString(object val)
    Parameters
    Type Name Description
    System.Object val
    Returns
    Type Description
    System.String

    FormatDate(DateTime, String)

    Returns the specified datetime formatted according to the specified format fmt

    Declaration
    public string FormatDate(DateTime d, string fmt = null)
    Parameters
    Type Name Description
    System.DateTime d

    The date to return as a formatted string

    System.String fmt

    The format to apply when displaying the datetime as a string

    Returns
    Type Description
    System.String

    A formatted representation of the supplied datetime

    HourDifference(DateTime, DateTime)

    Returns the number of hours between two dates

    Declaration
    public decimal HourDifference(DateTime date1, DateTime date2)
    Parameters
    Type Name Description
    System.DateTime date1

    The first date to find the number of hours difference with

    System.DateTime date2

    The second date to find the numbers of hours difference with

    Returns
    Type Description
    System.Decimal

    The number of hours between date1 and date2. If date2 is less than date1 the number will be negative

    If(Boolean, Object, Object)

    A logical comparisson. If the cond is true then TrueValue is returned, else FalseValue is returned

    Declaration
    public object If(bool cond, object TrueValue, object FalseValue)
    Parameters
    Type Name Description
    System.Boolean cond

    The condition to check for being true

    System.Object TrueValue

    Returned if cond is true

    System.Object FalseValue

    Returned if cond is false

    Returns
    Type Description
    System.Object

    TrueValue if cond is true, and FalseValue otherwise

    Int(Object)

    Converts the specified value to an integer representation

    Declaration
    public int Int(object value)
    Parameters
    Type Name Description
    System.Object value

    The value to return in integer form

    Returns
    Type Description
    System.Int32

    An integer representation of the supplied value

    IsBlank(String)

    Returns true if the specified value is null or empty

    Declaration
    public bool IsBlank(string item)
    Parameters
    Type Name Description
    System.String item

    The value to evaluate against being empty

    Returns
    Type Description
    System.Boolean

    True if the string is null or empty. False otherwise

    IsIn(Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    System.Object item5

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    System.Object item5

    An argument to check if is equal to searchFor

    System.Object item6

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    System.Object item5

    An argument to check if is equal to searchFor

    System.Object item6

    An argument to check if is equal to searchFor

    System.Object item7

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7, object item8)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    System.Object item5

    An argument to check if is equal to searchFor

    System.Object item6

    An argument to check if is equal to searchFor

    System.Object item7

    An argument to check if is equal to searchFor

    System.Object item8

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7, object item8, object item9)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    System.Object item5

    An argument to check if is equal to searchFor

    System.Object item6

    An argument to check if is equal to searchFor

    System.Object item7

    An argument to check if is equal to searchFor

    System.Object item8

    An argument to check if is equal to searchFor

    System.Object item9

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsIn(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)

    Returns true if searchFor is equal to any of the trailing item arguments

    Declaration
    public bool IsIn(object searchFor, object item1, object item2, object item3, object item4, object item5, object item6, object item7, object item8, object item9, object item10)
    Parameters
    Type Name Description
    System.Object searchFor

    The item to check if is in any of the item arguments

    System.Object item1

    An argument to check if is equal to searchFor

    System.Object item2

    An argument to check if is equal to searchFor

    System.Object item3

    An argument to check if is equal to searchFor

    System.Object item4

    An argument to check if is equal to searchFor

    System.Object item5

    An argument to check if is equal to searchFor

    System.Object item6

    An argument to check if is equal to searchFor

    System.Object item7

    An argument to check if is equal to searchFor

    System.Object item8

    An argument to check if is equal to searchFor

    System.Object item9

    An argument to check if is equal to searchFor

    System.Object item10

    An argument to check if is equal to searchFor

    Returns
    Type Description
    System.Boolean

    True if searchFor is equal to any of the item arguments

    IsNull(Object)

    Indicates if the specified value is equal to null

    Declaration
    public bool IsNull(object value)
    Parameters
    Type Name Description
    System.Object value

    The value to check if it is null

    Returns
    Type Description
    System.Boolean

    True if the value is null

    Len(String)

    Returns the length of a given string

    Declaration
    public int Len(string str)
    Parameters
    Type Name Description
    System.String str

    The string to return the length of

    Returns
    Type Description
    System.Int32

    The length of a given string

    Lower(String)

    Returns a given string in all lowercase

    Declaration
    public string Lower(string value)
    Parameters
    Type Name Description
    System.String value

    The string to be converted to all lowercase

    Returns
    Type Description
    System.String

    A lowercase version of the value string

    Max(Double, Double, Double, Double, Double)

    Returns the maximum number from the set of supplied numbers

    Declaration
    public double Max(double v1, double v2, double v3 = -1.7976931348623157E+308, double v4 = -1.7976931348623157E+308, double v5 = -1.7976931348623157E+308)
    Parameters
    Type Name Description
    System.Double v1

    A number to be returned if it is the largest number from all supplied numbers

    System.Double v2

    A number to be returned if it is the largest number from all supplied numbers

    System.Double v3

    A number to be returned if it is the largest number from all supplied numbers

    System.Double v4

    A number to be returned if it is the largest number from all supplied numbers

    System.Double v5

    A number to be returned if it is the largest number from all supplied numbers

    Returns
    Type Description
    System.Double

    The number that is the largest number from all supplied numbers

    Min(Double, Double, Double, Double, Double)

    Returns the minimum number from the set of supplied numbers

    Declaration
    public double Min(double v1, double v2, double v3 = 1.7976931348623157E+308, double v4 = 1.7976931348623157E+308, double v5 = 1.7976931348623157E+308)
    Parameters
    Type Name Description
    System.Double v1

    A number to be returned if it is the lowest number from all supplied numbers

    System.Double v2

    A number to be returned if it is the lowest number from all supplied numbers

    System.Double v3

    A number to be returned if it is the lowest number from all supplied numbers

    System.Double v4

    A number to be returned if it is the lowest number from all supplied numbers

    System.Double v5

    A number to be returned if it is the lowest number from all supplied numbers

    Returns
    Type Description
    System.Double

    The number that is the lowest number from all supplied numbers

    MinuteDifference(DateTime, DateTime)

    Returns the number of minutes between two dates

    Declaration
    public decimal MinuteDifference(DateTime date1, DateTime date2)
    Parameters
    Type Name Description
    System.DateTime date1

    The first date to find the number of minutes difference with

    System.DateTime date2

    The second date to find the numbers of minutes difference with

    Returns
    Type Description
    System.Decimal

    The number of minutes between date1 and date2. If date2 is less than date1 the number will be negative

    Mod(Double, Double)

    Returns the modulus of x % y

    Declaration
    public double Mod(double x, double y)
    Parameters
    Type Name Description
    System.Double x

    The x argument for the mod operation

    System.Double y

    The y argument for the mod operation

    Returns
    Type Description
    System.Double

    x % y

    Money(Object)

    Returns the specified number as a money formatted string

    Declaration
    public string Money(object d)
    Parameters
    Type Name Description
    System.Object d

    The number to return as a money formatted string

    Returns
    Type Description
    System.String

    A money formatted string representation of the provided number

    Month(DateTime)

    Returns the month value of a given date

    Declaration
    public int Month(DateTime d)
    Parameters
    Type Name Description
    System.DateTime d

    The date to get the month value of

    Returns
    Type Description
    System.Int32

    The month of a given date

    Not(Boolean)

    Returns the opposite of the a value

    Declaration
    public bool Not(bool a)
    Parameters
    Type Name Description
    System.Boolean a

    The value to return the opposite of

    Returns
    Type Description
    System.Boolean

    True if the passed a value is false, and false if it is true

    Now()

    Returns the current date time

    Declaration
    public DateTime Now()
    Returns
    Type Description
    System.DateTime

    The current date time

    Null()

    Returns the null value

    Declaration
    public object Null()
    Returns
    Type Description
    System.Object

    The null value

    NullDate()

    Returns a null date value

    Declaration
    public DateTime NullDate()
    Returns
    Type Description
    System.DateTime

    A null date value

    Or(Boolean, Boolean)

    Returns true if either value a or b is true

    Declaration
    public bool Or(bool a, bool b)
    Parameters
    Type Name Description
    System.Boolean a

    The first value to check if it holds true

    System.Boolean b

    The second value to check if it hold true

    Returns
    Type Description
    System.Boolean

    True if either value a or b is true

    PadLeft(String, Int32, Char)

    Returns a new string by padding the start of this string with the specified paddingChar to create a string with the specified totalWidth

    Declaration
    public string PadLeft(string str, int totalWidth, char paddingChar = ' ')
    Parameters
    Type Name Description
    System.String str

    The string to pad the start with

    System.Int32 totalWidth

    The total length of the returned string

    System.Char paddingChar

    The character to repeatedly pad the start of the string with until it is equal to the totalWidth

    Returns
    Type Description
    System.String

    A new string that has a total length of totalWidth and has the start padded with repeating paddingChar to ensure that length from the original str

    PadRight(String, Int32, Char)

    Returns a new string by padding the end of this string with the specified paddingChar to create a string with the specified totalWidth

    Declaration
    public string PadRight(string str, int totalWidth, char paddingChar = ' ')
    Parameters
    Type Name Description
    System.String str

    The string to pad the end with

    System.Int32 totalWidth

    The total length of the returned string

    System.Char paddingChar

    The character to repeatedly pad the end of the string with until it is equal to the totalWidth

    Returns
    Type Description
    System.String

    A new string that has a total length of totalWidth and has the end padded with repeating paddingChar to ensure that length from the original str

    Power(Double, Double)

    Returns a specified number raised to the specified power

    Declaration
    public double Power(double v, double e)
    Parameters
    Type Name Description
    System.Double v

    The number to raise to the specified power e

    System.Double e

    The power to raise the specified number v by

    Returns
    Type Description
    System.Double

    A number raised to the specified power

    Random(Int32, Int32)

    Returns a value that is randomly chosen to be greater than or equal to minValue and less than or equal to maxValue

    Declaration
    public int Random(int minValue, int maxValue)
    Parameters
    Type Name Description
    System.Int32 minValue

    The minimum value the randomly generated number can be

    System.Int32 maxValue

    The maximum value the randomly generated number can be

    Returns
    Type Description
    System.Int32

    A random number greater than or equal to minValue and less than or equal to maxValue

    Replace(String, String, String)

    Returns a new string in which all occurances of search are replaced with repl

    Declaration
    public string Replace(string s, string search, string repl)
    Parameters
    Type Name Description
    System.String s

    The string to create a new string from with any instances of the specified search replaced with repl

    System.String search

    The string to search for and replace with repl

    System.String repl

    The string to replace all instances of search with

    Returns
    Type Description
    System.String

    A new string from s in which all instances of search are replaced with repl

    Round(Object)

    Converts the specified value to a double representation

    Declaration
    public double Round(object value)
    Parameters
    Type Name Description
    System.Object value

    The value to return in double form

    Returns
    Type Description
    System.Double

    A double representation of the supplied value

    Round(Object, Int32)

    Rounds the specified number to the specified number of fractional units

    Declaration
    public double Round(object value, int decimalPlaces)
    Parameters
    Type Name Description
    System.Object value

    The number to be rounded

    System.Int32 decimalPlaces

    The number of decimal places to round to

    Returns
    Type Description
    System.Double

    A new number rounded to the specified number of decimal places

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare5

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue5

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare5

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue5

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare6

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue6

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare5

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue5

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare6

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue6

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare7

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue7

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> compare8, Func<Task<object>> trueValue8, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare5

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue5

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare6

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue6

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare7

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue7

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare8

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue8

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> compare8, Func<Task<object>> trueValue8, Func<Task<object>> compare9, Func<Task<object>> trueValue9, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare5

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue5

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare6

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue6

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare7

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue7

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare8

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue8

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare9

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue9

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    SelectCase(Object, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>, Func<Task<Object>>)

    Compares objCompare to the result of the compareValue functions. If the object is equal then it return the result of the corrosponding trueValue function. If there are no matches then the result of the elseValue function is returned

    Declaration
    public Task<object> SelectCase(object objCompare, Func<Task<object>> compare1, Func<Task<object>> trueValue1, Func<Task<object>> compare2, Func<Task<object>> trueValue2, Func<Task<object>> compare3, Func<Task<object>> trueValue3, Func<Task<object>> compare4, Func<Task<object>> trueValue4, Func<Task<object>> compare5, Func<Task<object>> trueValue5, Func<Task<object>> compare6, Func<Task<object>> trueValue6, Func<Task<object>> compare7, Func<Task<object>> trueValue7, Func<Task<object>> compare8, Func<Task<object>> trueValue8, Func<Task<object>> compare9, Func<Task<object>> trueValue9, Func<Task<object>> compare10, Func<Task<object>> trueValue10, Func<Task<object>> elseValue)
    Parameters
    Type Name Description
    System.Object objCompare

    The object to compare against the compare functions

    System.Func<System.Threading.Tasks.Task<System.Object>> compare1

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue1

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare2

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue2

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare3

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue3

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare4

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue4

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare5

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue5

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare6

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue6

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare7

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue7

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare8

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue8

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare9

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue9

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> compare10

    A function that returns a value for comparrison with objCompare. If it matches the corrosponding trueValue function is evaluated and returned.

    System.Func<System.Threading.Tasks.Task<System.Object>> trueValue10

    A function that holds the result to be returned when the corrosponding compare function matches with objCompare

    System.Func<System.Threading.Tasks.Task<System.Object>> elseValue

    If no matches are found at all then this function is evaluated and returned

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Object>

    The result of a trueValue function if a corrosponding compare function matches objCompare else returns the result of elseValue if no matches are found

    Remarks

    Task functionas are used for this select comparrison so as not to evaluate any comparrisons until actually needed.

    Sin(Double)

    Returns the sine of the specified angle

    Declaration
    public double Sin(double v)
    Parameters
    Type Name Description
    System.Double v

    The angle to return the sine of

    Returns
    Type Description
    System.Double

    The sine of v

    Sqrt(Double)

    Returns the square root of a specified number

    Declaration
    public double Sqrt(double v)
    Parameters
    Type Name Description
    System.Double v

    The number to return the square root of

    Returns
    Type Description
    System.Double

    The square root of a given number

    Substr(String, Int32, Int32)

    Returns a specified portion of the given string

    Declaration
    public string Substr(string s, int from, int len = 2147483647)
    Parameters
    Type Name Description
    System.String s

    The string to return a portion of

    System.Int32 from

    The 0 based index in the string to start the return string from

    System.Int32 len

    The length of the string to return starting from from

    Returns
    Type Description
    System.String

    A new string that starts at position from and is len characters long

    Today()

    Returns the current date with a time set to 00:00:00

    Declaration
    public DateTime Today()
    Returns
    Type Description
    System.DateTime

    The current date with a time set to 00:00:00

    TodayString()

    Returns the current date in international date format - Year-Month-Day

    Declaration
    public string TodayString()
    Returns
    Type Description
    System.String

    The current date in international date format - Year-Month-Day

    Trim(String)

    Removes all leading and trailing white space characters from str

    Declaration
    public string Trim(string str)
    Parameters
    Type Name Description
    System.String str

    The string to trim

    Returns
    Type Description
    System.String

    str without any leading or trailing white space characters

    TrimEnd(String, Char[])

    Removes all occurances of the trimChars set of characters that are trailing characters from str

    Declaration
    public string TrimEnd(string str, char[] trimChars)
    Parameters
    Type Name Description
    System.String str

    The string to trim

    System.Char[] trimChars

    The set of characters to remove as trailing characters

    Returns
    Type Description
    System.String

    str without the any trailing characters from the set of trimChars

    TrimStart(String, Char[])

    Removes all occurances of the trimChars set of characters that are leading characters from str

    Declaration
    public string TrimStart(string str, char[] trimChars)
    Parameters
    Type Name Description
    System.String str

    The string to trim

    System.Char[] trimChars

    The set of characters to remove as leading characters

    Returns
    Type Description
    System.String

    str without the any leading characters from the set of trimChars

    Trunc(Double, Int32)

    Truncates the specified number to a given prec precision

    Declaration
    public double Trunc(double value, int prec = 0)
    Parameters
    Type Name Description
    System.Double value

    The value to truncate

    System.Int32 prec

    The rpecision to truncate the value to

    Returns
    Type Description
    System.Double

    A new double with the given value with the specified precision

    Upper(String)

    Returns a given string in all uppercase

    Declaration
    public string Upper(string value)
    Parameters
    Type Name Description
    System.String value

    The string to be converted to all uppercase

    Returns
    Type Description
    System.String

    A uppercase version of the value string

    ValBool(Object)

    Returns the value converted to a boolean representation

    Declaration
    public bool ValBool(object v)
    Parameters
    Type Name Description
    System.Object v

    The value to convert to a boolean

    Returns
    Type Description
    System.Boolean

    A boolean representation of the supplied value

    ValDate(Object)

    Returns the value converted to a datetime representation

    Declaration
    public DateTime ValDate(object v)
    Parameters
    Type Name Description
    System.Object v

    The value to convert to a datetime

    Returns
    Type Description
    System.DateTime

    A datetime representation of the supplied value

    ValDecimal(Object)

    Returns the value converted to a decimal representation

    Declaration
    public decimal ValDecimal(object v)
    Parameters
    Type Name Description
    System.Object v

    The value to convert to a decimal

    Returns
    Type Description
    System.Decimal

    A decimal representation of the supplied value

    ValID(Object)

    Returns the value converted to a guid representation

    Declaration
    public Guid ValID(object v)
    Parameters
    Type Name Description
    System.Object v

    The value to convert to a guid

    Returns
    Type Description
    System.Guid

    A guid representation of the supplied value

    ValLong(Object)

    Returns the value converted to a long representation

    Declaration
    public long ValLong(object v)
    Parameters
    Type Name Description
    System.Object v

    The value to convert to a long

    Returns
    Type Description
    System.Int64

    A long representation of the supplied value

    ValString(Object)

    Returns the specified value formatted as a string

    Declaration
    public string ValString(object v)
    Parameters
    Type Name Description
    System.Object v

    The value to return as a string

    Returns
    Type Description
    System.String

    A string representation of the supplied value

    WCase(String)

    Returns a given string with a capitalized first letter, followed by all lowercase letters

    Declaration
    public string WCase(string value)
    Parameters
    Type Name Description
    System.String value

    The string to be converted to an initial uppercase and followed by all lowercase letters

    Returns
    Type Description
    System.String

    A version of the value string with an initial uppercase letter followed by all lowercase

    WeekDay(DateTime)

    Returns the day of the week from the value of a given date

    Declaration
    public int WeekDay(DateTime d)
    Parameters
    Type Name Description
    System.DateTime d

    The date to get the day of the week value of

    Returns
    Type Description
    System.Int32

    The day of the week for a given date

    Year(DateTime)

    Returns the year value of a given date

    Declaration
    public int Year(DateTime d)
    Parameters
    Type Name Description
    System.DateTime d

    The date to get the year value of

    Returns
    Type Description
    System.Int32

    The year of a given date

    YearDifference(DateTime, DateTime)

    Returns the number of years between two dates

    Declaration
    public decimal YearDifference(DateTime date1, DateTime date2)
    Parameters
    Type Name Description
    System.DateTime date1

    The first date to find the number of years difference with

    System.DateTime date2

    The second date to find the numbers of years difference with

    Returns
    Type Description
    System.Decimal

    The number of years between date1 and date2. If date2 is less than date1 the number will be negative

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.