C# Класс Ctc.Ods.Utility

Contains a collections of useful methods/properties/objects.
Показать файл Открыть проект

Открытые методы

Метод Описание
CircularDigitSum ( ushort value, short adder ) : ushort

Performs addition on a single-digit value, wrapping around the boundries

THIS MEMBER DOES NOT YET HAVE UNIT TESTS At the moment, this method only supports an adder value of 1 or -1.

This method was originally created to support YearQuarter calculations.

DigitToChar ( ushort value ) : char

Converts a single digit to a value

THIS MEMBER DOES NOT YET HAVE UNIT TESTS

This method was originally created to support YearQuarter calculations.

GetApiSettings ( ) : ApiSettings

GetApplicationVersion ( Assembly dll, string format = null ) : string

Retrieve a dll's Version, with formatting if supplied

THIS MEMBER DOES NOT YET HAVE UNIT TESTS

GetHpTime ( System.TimeSpan timeSpan ) : System.DateTime

Creates a DateTime object which conforms to HP fields - which only contain meaningful time information.

THIS MEMBER DOES NOT YET HAVE UNIT TESTS

IsAlphaNumeric ( string strValue ) : bool

Identifies whether or not the supplied value contains letters and/or numbers

THIS MEMBER DOES NOT YET HAVE UNIT TESTS

IsNumber ( string str ) : bool

Identifies whether the specified String can be converted to a number

THIS MEMBER DOES NOT YET HAVE UNIT TESTS

SafeConvertToBool ( string value ) : bool

Safely converts a value to a

Unlike the standard Boolean conversion methods, SafeConvertToBool will silentsly return false if it encounters an error during the conversion attempt.

TitleCase ( string str ) : string

Capitalizes the first letter of each word in a String

THIS MEMBER DOES NOT YET HAVE UNIT TESTS This method utilizes code taken from this forum post.

TrimCommonCourseChar ( string courseSubject ) : string

Removes the ApiSettings.RegexPatterns.CommonCourseChar from the end of a string.

Приватные методы

Метод Описание
ReplaceIfPresent ( string &buffer, string token, int component ) : void

Описание методов

CircularDigitSum() публичный статический Метод

Performs addition on a single-digit value, wrapping around the boundries
THIS MEMBER DOES NOT YET HAVE UNIT TESTS At the moment, this method only supports an adder value of 1 or -1.

This method was originally created to support YearQuarter calculations.

public static CircularDigitSum ( ushort value, short adder ) : ushort
value ushort A single digit unsigned number
adder short How much to add to
Результат ushort

DigitToChar() публичный статический Метод

Converts a single digit to a value
THIS MEMBER DOES NOT YET HAVE UNIT TESTS

This method was originally created to support YearQuarter calculations.

public static DigitToChar ( ushort value ) : char
value ushort A single digit unsigned number
Результат char

GetApiSettings() публичный статический Метод

public static GetApiSettings ( ) : ApiSettings
Результат Ctc.Ods.Config.ApiSettings

GetApplicationVersion() публичный статический Метод

Retrieve a dll's Version, with formatting if supplied
THIS MEMBER DOES NOT YET HAVE UNIT TESTS
public static GetApplicationVersion ( Assembly dll, string format = null ) : string
dll System.Reflection.Assembly
format string /// A simple template. The following token placeholders are recognized: /// /// /// Token /// Replaced with /// /// /// {MAJOR} /// /// /// /// {MINOR} /// /// /// /// {REVISION} /// /// /// /// {BUILD} /// /// /// ///
Результат string

GetHpTime() публичный статический Метод

Creates a DateTime object which conforms to HP fields - which only contain meaningful time information.
THIS MEMBER DOES NOT YET HAVE UNIT TESTS
public static GetHpTime ( System.TimeSpan timeSpan ) : System.DateTime
timeSpan System.TimeSpan
Результат System.DateTime

IsAlphaNumeric() публичный статический Метод

Identifies whether or not the supplied value contains letters and/or numbers
THIS MEMBER DOES NOT YET HAVE UNIT TESTS
public static IsAlphaNumeric ( string strValue ) : bool
strValue string The value to check.
Результат bool

IsNumber() публичный статический Метод

Identifies whether the specified String can be converted to a number
THIS MEMBER DOES NOT YET HAVE UNIT TESTS
public static IsNumber ( string str ) : bool
str string
Результат bool

SafeConvertToBool() публичный статический Метод

Safely converts a value to a
Unlike the standard Boolean conversion methods, SafeConvertToBool will silentsly return false if it encounters an error during the conversion attempt.
public static SafeConvertToBool ( string value ) : bool
value string The value to attempt to convert
Результат bool

TitleCase() публичный статический Метод

Capitalizes the first letter of each word in a String
THIS MEMBER DOES NOT YET HAVE UNIT TESTS This method utilizes code taken from this forum post.
public static TitleCase ( string str ) : string
str string
Результат string

TrimCommonCourseChar() публичный статический Метод

Removes the ApiSettings.RegexPatterns.CommonCourseChar from the end of a string.
public static TrimCommonCourseChar ( string courseSubject ) : string
courseSubject string
Результат string