C# Class Open.Core.Controls.Buttons.ButtonView

Base class for buttons.
Inheritance: ViewBase, IButtonView
Show file Open project: philcockfield/Open.TestHarness.SL Class Usage Examples

Public Properties

Property Type Description
AllStates ButtonState[]
DownAndPressed ButtonState[]
NotDownOrPressed ButtonState[]

Protected Properties

Property Type Description
clickMask jQueryObject

Public Methods

Method Description
CssForState ( int layer, ButtonState state, string cssClasses, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void

Sets the CSS class(es) to use for a given layer.

CssForStates ( int layer, ButtonState states, string cssClasses, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void

Sets the CSS class(es) to use for a given layer.

TemplateForState ( int layer, ButtonState state, string templateSelector, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void

Creates a Template with the specified selector and adds it as content for the given state.

TemplateForStates ( int layer, ButtonState states, string templateSelector, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void

Creates a Template with the specified selector and adds it as content for the given state.

UpdateLayout ( ) : void

Updates the visual state of the button.

Protected Methods

Method Description
AddRequiredTemplate ( string selector, string url ) : void

Adds a template to the list of resoures to download (if it's not already available in the page).

Aftering adding one or more Templates Url's call the 'DownloadTemplates' method.

ButtonView ( IButton model, jQueryObject container ) : System

Constructor.

ButtonView ( IButton model, jQueryObject container, jQueryObject clickMask ) : System

Constructor.

ClearContent ( ) : void

Clears all CSS and Template content which has been added to the button.

CreateAndAppendContainer ( string cssClass ) : jQueryObject
DownloadTemplates ( System.Action onComplete ) : void

Downloads the set of required templates that were added via the 'AddRequiredTemplate' method.

OnDisposed ( ) : void

Destructor.

OnRendered ( ) : void

Invoked immediately after the button has rendered it's state.

OnRendering ( ) : void

Invoked immediately before the button has rendered it's state.

OnUpdateLayout ( ) : void

Implement layout logic in deriving classes.

SyncDimension ( SizeDimension dimension ) : void

Syncs the specified of the button with the model (if it has size values. See 'NoSize' constant).

SyncSize ( ) : void

Syncs the size of the button with the model (if it has size values. See 'NoSize' constant).

Private Methods

Method Description
ButtonView ( ) : System
ButtonView ( IButton model ) : System
CreateContainer ( string cssClass ) : jQueryObject
CssForState ( int layer, ButtonState state, string cssClasses ) : void
CssForStates ( int layer, ButtonState states, string cssClasses ) : void
FireStateChanged ( ) : void
InitContainer ( jQueryObject container ) : jQueryObject
OnEventControllerPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
OnKeyPress ( int keyCode ) : void
OnLayoutInvalidated ( object sender, EventArgs e ) : void
OnModelPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
SyncCanFocus ( ) : void
TemplateForState ( int layer, ButtonState state, string templateSelector ) : void
TemplateForStates ( int layer, ButtonState states, string templateSelector ) : void

Method Details

AddRequiredTemplate() protected method

Adds a template to the list of resoures to download (if it's not already available in the page).
Aftering adding one or more Templates Url's call the 'DownloadTemplates' method.
protected AddRequiredTemplate ( string selector, string url ) : void
selector string The CSS selector for the template.
url string The URL to download the template(s) from.
return void

ButtonView() protected method

Constructor.
protected ButtonView ( IButton model, jQueryObject container ) : System
model IButton The logical model of the button
container jQueryObject The HTML container of the button.
return System

ButtonView() protected method

Constructor.
protected ButtonView ( IButton model, jQueryObject container, jQueryObject clickMask ) : System
model IButton The logical model of the button
container jQueryObject The HTML container of the button.
clickMask jQueryObject The element used catch mouse events.
return System

ClearContent() protected method

Clears all CSS and Template content which has been added to the button.
protected ClearContent ( ) : void
return void

CreateAndAppendContainer() protected method

protected CreateAndAppendContainer ( string cssClass ) : jQueryObject
cssClass string
return jQueryObject

CssForState() public method

Sets the CSS class(es) to use for a given layer.
public CssForState ( int layer, ButtonState state, string cssClasses, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void
layer int The layer the state is rendered on (0 lowest, higher values fall in front of lower values)
state ButtonState The state the CSS classes apply to.
cssClasses string A string containing one or more CSS class names.
enabledCondition EnabledCondition The enabled-related conditions for which button content applies.
focusCondition FocusCondition The focus-related conditions for which button content applies.
return void

CssForStates() public method

Sets the CSS class(es) to use for a given layer.
public CssForStates ( int layer, ButtonState states, string cssClasses, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void
layer int The layer the state is rendered on (0 lowest, higher values fall in front of lower values)
states ButtonState The state(s) the CSS classes apply to.
cssClasses string A string containing one or more CSS class names.
enabledCondition EnabledCondition The enabled-related conditions for which button content applies.
focusCondition FocusCondition The focus-related conditions for which button content applies.
return void

DownloadTemplates() protected method

Downloads the set of required templates that were added via the 'AddRequiredTemplate' method.
protected DownloadTemplates ( System.Action onComplete ) : void
onComplete System.Action Action which is invoked when the templates have completed downloading.
return void

OnDisposed() protected method

Destructor.
protected OnDisposed ( ) : void
return void

OnRendered() protected method

Invoked immediately after the button has rendered it's state.
protected OnRendered ( ) : void
return void

OnRendering() protected method

Invoked immediately before the button has rendered it's state.
protected OnRendering ( ) : void
return void

OnUpdateLayout() protected method

Implement layout logic in deriving classes.
protected OnUpdateLayout ( ) : void
return void

SyncDimension() protected method

Syncs the specified of the button with the model (if it has size values. See 'NoSize' constant).
protected SyncDimension ( SizeDimension dimension ) : void
dimension SizeDimension The size dimension to sync.
return void

SyncSize() protected method

Syncs the size of the button with the model (if it has size values. See 'NoSize' constant).
protected SyncSize ( ) : void
return void

TemplateForState() public method

Creates a Template with the specified selector and adds it as content for the given state.
public TemplateForState ( int layer, ButtonState state, string templateSelector, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void
layer int The layer the state is rendered on (0 lowest, higher values fall in front of lower values)
state ButtonState The state the template applies to.
templateSelector string The CSS selector where the template can be found.
enabledCondition EnabledCondition The enabled-related conditions for which button content applies.
focusCondition FocusCondition The focus-related conditions for which button content applies.
return void

TemplateForStates() public method

Creates a Template with the specified selector and adds it as content for the given state.
public TemplateForStates ( int layer, ButtonState states, string templateSelector, EnabledCondition enabledCondition, FocusCondition focusCondition ) : void
layer int The layer the state is rendered on (0 lowest, higher values fall in front of lower values)
states ButtonState The states the template applies to.
templateSelector string The CSS selector where the template can be found.
enabledCondition EnabledCondition The enabled-related conditions for which button content applies.
focusCondition FocusCondition The focus-related conditions for which button content applies.
return void

UpdateLayout() public method

Updates the visual state of the button.
public UpdateLayout ( ) : void
return void

Property Details

AllStates public static property

public static ButtonState[] AllStates
return ButtonState[]

DownAndPressed public static property

public static ButtonState[] DownAndPressed
return ButtonState[]

NotDownOrPressed public static property

public static ButtonState[] NotDownOrPressed
return ButtonState[]

clickMask protected property

protected jQueryObject clickMask
return jQueryObject