C# 클래스 Fluqi.Helpers.Utils

Set of helper methods for accomplishing various things.
파일 보기 프로젝트 열기: toepoke/Fluqi

공개 메소드들

메소드 설명
AddQuotesToJQueryDate ( string dateValue ) : bool

Works out what type of date value or object is being passed in (i.e. is a string date like "01/01/2000", a numerical date value like "3" for 3 days, or a relative date specification like "+1w -1d" where some of them need quotes, but other don't.

InDoubleQuotes ( string value ) : string

Surrounds the value in double quote marks.

InSingleQuotes ( string value ) : string

Surrounds the value in single quote marks.

IsBool ( string value ) : bool

Establishes if the given value is a numeric value or not (note +10 and -10 are considered numeric too).

IsEmptyQuotes ( string value ) : bool

Establishes if the given value is merely a set of empty quotes (either "" or '').

IsJSON ( string value ) : bool

Establishes whether the given value is considered to be a JSON string

To determine this we simply look for the presence of "{", "}", "," or ":"

IsNullEmptyOrDefault ( List values, List defaultValues ) : bool

Establishes if the given value is null, empty or the same as the default. We look at the default value because if we're rendering the default we don't need to output the setting (as it's the default for the jQuery UI control) and thus we can reduce the JavaScript needed to initialise the control (which can be fairly big if you've got 20+ options (never mind readability!))

IsNullEmptyOrDefault ( string value, string defaultValue ) : bool

Establishes if the given value is null, empty or the same as the default. We look at the default value because if we're rendering the default we don't need to output the setting (as it's the default for the jQuery UI control) and thus we can reduce the JavaScript needed to initialise the control (which can be fairly big if you've got 20+ options (never mind readability!))

IsNumeric ( string value ) : bool

Establishes if the given value is a numeric value or not (note +10 and -10 are considered numeric too).

IsQuoted ( string value ) : bool

Simple query method to work out if a given string has any quotation ('") marks at the start of end of the string

IsRelativeDateSpec ( string value ) : bool

Establishes whether the given value is considered to be a string representing a relative date. Some jQuery UI controls (mainly DatePicker) allow you to specify a relate date, "+10d" is "10 days in the future" and "-1m" is "one month in the past"

IsSelector ( string value ) : bool

Establishes whether the given value is considered to be a [jQuery] selector string

TrimQuotes ( string value ) : string

Simply removes any quotations marks at the start/end of a given string. This is usually so we can remove any added by the user and add our own (otherwise we could add a second set of quotes that aren't required.

비공개 메소드들

메소드 설명
Quote ( string value, bool doubleQuote ) : string

Surrounds the value in double quote marks.

메소드 상세

AddQuotesToJQueryDate() 공개 정적인 메소드

Works out what type of date value or object is being passed in (i.e. is a string date like "01/01/2000", a numerical date value like "3" for 3 days, or a relative date specification like "+1w -1d" where some of them need quotes, but other don't.
public static AddQuotesToJQueryDate ( string dateValue ) : bool
dateValue string Value to be queried
리턴 bool

InDoubleQuotes() 공개 정적인 메소드

Surrounds the value in double quote marks.
public static InDoubleQuotes ( string value ) : string
value string String to be quoted
리턴 string

InSingleQuotes() 공개 정적인 메소드

Surrounds the value in single quote marks.
public static InSingleQuotes ( string value ) : string
value string String to be quoted
리턴 string

IsBool() 공개 정적인 메소드

Establishes if the given value is a numeric value or not (note +10 and -10 are considered numeric too).
public static IsBool ( string value ) : bool
value string Value to query
리턴 bool

IsEmptyQuotes() 공개 정적인 메소드

Establishes if the given value is merely a set of empty quotes (either "" or '').
public static IsEmptyQuotes ( string value ) : bool
value string String to check
리턴 bool

IsJSON() 공개 정적인 메소드

Establishes whether the given value is considered to be a JSON string
To determine this we simply look for the presence of "{", "}", "," or ":"
public static IsJSON ( string value ) : bool
value string Value to be queried
리턴 bool

IsNullEmptyOrDefault() 공개 정적인 메소드

Establishes if the given value is null, empty or the same as the default. We look at the default value because if we're rendering the default we don't need to output the setting (as it's the default for the jQuery UI control) and thus we can reduce the JavaScript needed to initialise the control (which can be fairly big if you've got 20+ options (never mind readability!))
public static IsNullEmptyOrDefault ( List values, List defaultValues ) : bool
values List Options being set
defaultValues List Defaults for the option
리턴 bool

IsNullEmptyOrDefault() 공개 정적인 메소드

Establishes if the given value is null, empty or the same as the default. We look at the default value because if we're rendering the default we don't need to output the setting (as it's the default for the jQuery UI control) and thus we can reduce the JavaScript needed to initialise the control (which can be fairly big if you've got 20+ options (never mind readability!))
public static IsNullEmptyOrDefault ( string value, string defaultValue ) : bool
value string Options being set
defaultValue string Default for the option
리턴 bool

IsNumeric() 공개 정적인 메소드

Establishes if the given value is a numeric value or not (note +10 and -10 are considered numeric too).
public static IsNumeric ( string value ) : bool
value string Value to query
리턴 bool

IsQuoted() 공개 정적인 메소드

Simple query method to work out if a given string has any quotation ('") marks at the start of end of the string
public static IsQuoted ( string value ) : bool
value string
리턴 bool

IsRelativeDateSpec() 공개 정적인 메소드

Establishes whether the given value is considered to be a string representing a relative date. Some jQuery UI controls (mainly DatePicker) allow you to specify a relate date, "+10d" is "10 days in the future" and "-1m" is "one month in the past"
public static IsRelativeDateSpec ( string value ) : bool
value string Value to be queried
리턴 bool

IsSelector() 공개 정적인 메소드

Establishes whether the given value is considered to be a [jQuery] selector string
public static IsSelector ( string value ) : bool
value string Value to be queried
리턴 bool

TrimQuotes() 공개 정적인 메소드

Simply removes any quotations marks at the start/end of a given string. This is usually so we can remove any added by the user and add our own (otherwise we could add a second set of quotes that aren't required.
public static TrimQuotes ( string value ) : string
value string
리턴 string