C# Class 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).
Datei anzeigen Open project: toepoke/Fluqi

Public Methods

Method Description
Options ( ) : System

Constructor

ToString ( ) : string

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

Protected Methods

Method Description
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

Method Details

DiscoverOptions() protected method

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
return void

IsBool() protected method

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
return bool

IsDefault() protected method

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
return bool

IsEmptyQuotes() protected method

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

IsJSON() protected method

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
return bool

IsNullEmptyOrDefault() protected method

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
return bool

IsNullEmptyOrDefault() protected method

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
return bool

IsNullOrEmpty() protected method

Shortcut for working out if the given parameter is null or empty
protected IsNullOrEmpty ( string value ) : bool
value string Value to query
return bool

IsNumeric() protected method

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
return bool

IsRelativeDateSpec() protected method

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
return bool

IsSelector() protected method

Establishes whether the given value is considered to be a [jQuery] selector string
protected IsSelector ( string value ) : bool
value string Value to be queried
return bool

Options() public method

Constructor
public Options ( ) : System
return System

ToString() public method

Renders the JavaScript required to set the options with the settings that are configured for this widget.
public ToString ( ) : string
return string