C# 클래스 Ctc.Ods.Utility

Contains a collections of useful methods/properties/objects.
파일 보기 프로젝트 열기: BellevueCollege/CtcApi

공개 메소드들

메소드 설명
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