C# Класс Fluqi.Core.Options

Models a set of options that are common against all jQuery UI and the class library. For instance "RenderCSS" is a decision you'd make across your application (i.e. do we care about non-JavaScript users or not).
Показать файл Открыть проект

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

Метод Описание
Options ( ) : System

Constructor

ToString ( ) : string

Renders the JavaScript required to set the options with the settings that are configured for this widget.

Защищенные методы

Метод Описание
DiscoverOptions ( Core options ) : void

Entry point for a widget to add a list of options that the widget should render when the JavaScript is written out.

IsBool ( string value ) : bool

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

IsDefault ( int value, int 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!))

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!))

IsNullOrEmpty ( string value ) : bool

Shortcut for working out if the given parameter is null or empty

IsNumeric ( string value ) : bool

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

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

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

DiscoverOptions() защищенный Метод

Entry point for a widget to add a list of options that the widget should render when the JavaScript is written out.
protected DiscoverOptions ( Core options ) : void
options Core List of options to add widget settings to
Результат void

IsBool() защищенный Метод

Establishes if the given value is a numeric value or not (note +10 and -10 are considered numeric too).
protected IsBool ( string value ) : bool
value string Value to query
Результат bool

IsDefault() защищенный Метод

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!))
protected IsDefault ( int value, int defaultValue ) : bool
value int Options being set
defaultValue int Default for the option
Результат bool

IsEmptyQuotes() защищенный Метод

Establishes if the given value is merely a set of empty quotes (either "" or '').
protected 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 ":"
protected 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!))
protected 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!))
protected IsNullEmptyOrDefault ( string value, string defaultValue ) : bool
value string Options being set
defaultValue string Default for the option
Результат bool

IsNullOrEmpty() защищенный Метод

Shortcut for working out if the given parameter is null or empty
protected IsNullOrEmpty ( string value ) : bool
value string Value to query
Результат bool

IsNumeric() защищенный Метод

Establishes if the given value is a numeric value or not (note +10 and -10 are considered numeric too).
protected IsNumeric ( string value ) : bool
value string Value to query
Результат 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"
protected 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
protected IsSelector ( string value ) : bool
value string Value to be queried
Результат bool

Options() публичный Метод

Constructor
public Options ( ) : System
Результат System

ToString() публичный Метод

Renders the JavaScript required to set the options with the settings that are configured for this widget.
public ToString ( ) : string
Результат string