C# Class Open.Core.Css

CSS utility.
Mostrar archivo Open project: philcockfield/Open.TestHarness.SL

Public Properties

Property Type Description
Classes CoreCssClasses
Urls CoreCssUrls

Public Methods

Method Description
AbsoluteFill ( jQueryObject element ) : jQueryObject

Sets the given element to absolute positioning and sets all edges to 0px.

AddClasses ( jQueryObject target, string classValue ) : jQueryObject

Adds a single class, or multiple classs from a space seperated list.

AddOrRemoveClass ( jQueryObject element, string cssClass, bool add ) : jQueryObject

Adds or removes a class from the given element.

ApplyDropshadow ( jQueryObject element, string opacity ) : jQueryObject

Applies a drop shadow.

Center ( jQueryObject element, jQueryObject within, Spacing offset ) : jQueryObject

Sets the left and top position of an element so it is centered within another element.

CenterHorizontally ( jQueryObject element, jQueryObject within, Spacing offset ) : jQueryObject

Sets the left position of an element so it is horizontally centered within another element.

CenterVertically ( jQueryObject element, jQueryObject within, Spacing offset ) : jQueryObject

Sets the top position of an element so it is vertically centered within another element.

CopyClasses ( jQueryObject source, jQueryObject target ) : void

Copies the CSS classes from one element to another.

GetDimension ( jQueryObject element, SizeDimension dimension ) : int

Retrieves the size for the given dimension (Width or Height).

GetLink ( string url ) : Element

Retrieves the CSS with the given source (src) URL.

GetPixelBorder ( jQueryObject element ) : Spacing

Retrieves the border outline size for the given element (if it's border styles are specified in pixels).

HasPosition ( jQueryObject element ) : bool

Retrieves whether the element has a position value.

InsertLink ( string url ) : void

Inserts a CSS link within the document head (only if the CSS is not already present).

IsLinked ( string url ) : bool

Determines whether the specified URL has a link within the page.

IsVisible ( jQueryObject element ) : bool

Determines whether the element is visible (has any display value other than 'None').

RoundedCorners ( jQueryObject element, int topLeft, int topRight, int bottomRight, int bottomLeft ) : void

Applies rounded corners to the given element.

SelectFromId ( string identifier ) : jQueryObject

Performs a jQuery CSS selection with the given ID (pre-processing the ID format using the ToId() method).

SetDimension ( jQueryObject element, SizeDimension dimension, int value ) : void

Sets the size for the given dimension (Width or Height).

SetDisplay ( jQueryObject element, bool isVisible ) : jQueryObject

Shows or hides the given element using the Display property (collapses when not visible).

SetOpacity ( jQueryObject element, double percent ) : jQueryObject

Applies opacity.

SetOverflow ( jQueryObject element, CssOverflow value ) : jQueryObject

Sets the overflow style on the given element.

SetSize ( jQueryObject element, int width, int height ) : jQueryObject

Sets the size of the element.

SetVisibility ( jQueryObject element, bool isVisible ) : jQueryObject

Shows or hides the given element using the Visibility property (retains space when not visible).

ToClass ( string @class ) : string

Prepends the period (.) to a CSS class name if it's not present (eg: id='one' would be '.one').

ToId ( string identifier ) : string

Prepends the # to a CSS identifier if it's not present (eg: id='one' would be '#one').

ToSizeDimension ( Plane plane ) : SizeDimension

Converts an X:Y plane dimension to it's corresponding size-dimension.

Private Methods

Method Description
Center ( jQueryObject element, jQueryObject within ) : jQueryObject
CenterHorizontally ( jQueryObject element, jQueryObject within ) : jQueryObject
CenterVertically ( jQueryObject element, jQueryObject within ) : jQueryObject
GetBorderEdge ( jQueryObject element, System.Edge edge ) : int
PrependSelectorPrefix ( string value, string prefix ) : string
RoundedCorners ( jQueryObject element, int pixelRadius ) : void

Method Details

AbsoluteFill() public static method

Sets the given element to absolute positioning and sets all edges to 0px.
public static AbsoluteFill ( jQueryObject element ) : jQueryObject
element jQueryObject The element to update.
return jQueryObject

AddClasses() public static method

Adds a single class, or multiple classs from a space seperated list.
public static AddClasses ( jQueryObject target, string classValue ) : jQueryObject
target jQueryObject The target element to add to.
classValue string The class attribute value to apply.
return jQueryObject

AddOrRemoveClass() public static method

Adds or removes a class from the given element.
public static AddOrRemoveClass ( jQueryObject element, string cssClass, bool add ) : jQueryObject
element jQueryObject The element to add or remove from.
cssClass string The CSS class name.
add bool Flag indicating whether the class should be added (true) or removed (false).
return jQueryObject

ApplyDropshadow() public static method

Applies a drop shadow.
public static ApplyDropshadow ( jQueryObject element, string opacity ) : jQueryObject
element jQueryObject The element to update.
opacity string Opacity of the drop-shadow (005, 010, 020, 030, 040, 050, 060).
return jQueryObject

Center() public static method

Sets the left and top position of an element so it is centered within another element.
public static Center ( jQueryObject element, jQueryObject within, Spacing offset ) : jQueryObject
element jQueryObject The element to center.
within jQueryObject The element to center within.
offset Spacing The offset to take into account when calculating position.
return jQueryObject

CenterHorizontally() public static method

Sets the left position of an element so it is horizontally centered within another element.
public static CenterHorizontally ( jQueryObject element, jQueryObject within, Spacing offset ) : jQueryObject
element jQueryObject The element to horizontally center.
within jQueryObject The element to center within.
offset Spacing The offset to take into account when calculating position.
return jQueryObject

CenterVertically() public static method

Sets the top position of an element so it is vertically centered within another element.
public static CenterVertically ( jQueryObject element, jQueryObject within, Spacing offset ) : jQueryObject
element jQueryObject The element to vertically center.
within jQueryObject The element to center within.
offset Spacing The offset to take into account when calculating position.
return jQueryObject

CopyClasses() public static method

Copies the CSS classes from one element to another.
public static CopyClasses ( jQueryObject source, jQueryObject target ) : void
source jQueryObject The source element to copy from.
target jQueryObject The target element to copy to.
return void

GetDimension() public static method

Retrieves the size for the given dimension (Width or Height).
public static GetDimension ( jQueryObject element, SizeDimension dimension ) : int
element jQueryObject The element to read.
dimension SizeDimension The dimension.
return int

GetLink() public static method

Retrieves the CSS with the given source (src) URL.
public static GetLink ( string url ) : Element
url string The path to the CSS document to match (not case-sensitive).
return System.Html.Element

GetPixelBorder() public static method

Retrieves the border outline size for the given element (if it's border styles are specified in pixels).
public static GetPixelBorder ( jQueryObject element ) : Spacing
element jQueryObject The element to examine.
return Spacing

HasPosition() public static method

Retrieves whether the element has a position value.
public static HasPosition ( jQueryObject element ) : bool
element jQueryObject The element to examine.
return bool

InsertLink() public static method

Inserts a CSS link within the document head (only if the CSS is not already present).
Thrown if a URL was not specified.
public static InsertLink ( string url ) : void
url string The URL of the CSS to load.
return void

IsLinked() public static method

Determines whether the specified URL has a link within the page.
public static IsLinked ( string url ) : bool
url string The path to the CSS document to match (not case-sensitive).
return bool

IsVisible() public static method

Determines whether the element is visible (has any display value other than 'None').
public static IsVisible ( jQueryObject element ) : bool
element jQueryObject The element to display.
return bool

RoundedCorners() public static method

Applies rounded corners to the given element.
public static RoundedCorners ( jQueryObject element, int topLeft, int topRight, int bottomRight, int bottomLeft ) : void
element jQueryObject The element to apply rounded corners to.
topLeft int The top-left pixel radius.
topRight int The top-right pixel radius.
bottomRight int The bottom-right pixel radius.
bottomLeft int The bottom-left pixel radius.
return void

SelectFromId() public static method

Performs a jQuery CSS selection with the given ID (pre-processing the ID format using the ToId() method).
public static SelectFromId ( string identifier ) : jQueryObject
identifier string The ID of the element.
return jQueryObject

SetDimension() public static method

Sets the size for the given dimension (Width or Height).
public static SetDimension ( jQueryObject element, SizeDimension dimension, int value ) : void
element jQueryObject The element to read.
dimension SizeDimension The dimension.
value int The value to set.
return void

SetDisplay() public static method

Shows or hides the given element using the Display property (collapses when not visible).
public static SetDisplay ( jQueryObject element, bool isVisible ) : jQueryObject
element jQueryObject The element to effect.
isVisible bool The desired visibility state.
return jQueryObject

SetOpacity() public static method

Applies opacity.
public static SetOpacity ( jQueryObject element, double percent ) : jQueryObject
element jQueryObject The element to effect.
percent double The opacity percentage (0..1).
return jQueryObject

SetOverflow() public static method

Sets the overflow style on the given element.
public static SetOverflow ( jQueryObject element, CssOverflow value ) : jQueryObject
element jQueryObject The element to update.
value CssOverflow The overflow value.
return jQueryObject

SetSize() public static method

Sets the size of the element.
public static SetSize ( jQueryObject element, int width, int height ) : jQueryObject
element jQueryObject The element to effect.
width int The pixel width of the element.
height int The pixel height of the element.
return jQueryObject

SetVisibility() public static method

Shows or hides the given element using the Visibility property (retains space when not visible).
public static SetVisibility ( jQueryObject element, bool isVisible ) : jQueryObject
element jQueryObject The element to effect.
isVisible bool The desired visibility state.
return jQueryObject

ToClass() public static method

Prepends the period (.) to a CSS class name if it's not present (eg: id='one' would be '.one').
public static ToClass ( string @class ) : string
@class string
return string

ToId() public static method

Prepends the # to a CSS identifier if it's not present (eg: id='one' would be '#one').
public static ToId ( string identifier ) : string
identifier string The ID value.
return string

ToSizeDimension() public static method

Converts an X:Y plane dimension to it's corresponding size-dimension.
public static ToSizeDimension ( Plane plane ) : SizeDimension
plane Plane The plane to convert.
return SizeDimension

Property Details

Classes public_oe static_oe property

public static CoreCssClasses,Open.Core Classes
return CoreCssClasses

Urls public_oe static_oe property

public static CoreCssUrls,Open.Core Urls
return CoreCssUrls