C# Class Open.Core.Html

HTML constants and DOM manipulation.
Show file Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
Append ( jQueryObject parent, string tag ) : jQueryObject

Creates and appends a DIV element within the given parent.

AppendDiv ( jQueryObject parent ) : jQueryObject

Creates and appends a DIV element within the given parent.

ChildAt ( int index, jQueryObject parent ) : jQueryObject

Retrieves the child at the specified index, otherwise Null.

CreateDiv ( ) : jQueryObject

Creates a DIV element.

CreateElement ( string tag ) : jQueryObject

Creates a new element with the given tag.

CreateImage ( string src, string alt ) : jQueryObject

Creates an IMG element.

CreateSpan ( ) : jQueryObject

Creates a SPAN element.

GetOrCreateId ( jQueryObject element ) : string

Gets the elements ID, creating a unique ID of the element doesn't already have one.

Height ( string cssSelector ) : int

Retrieves the height of the specified element.

OuterHtml ( jQueryObject element ) : string

Retreives the OuterHtml of the given element.

ReplaceWith ( string replaceSeletor, jQueryObject withReplacement, bool copyCssClasses ) : void

Replaces an element with the given object.

SetDisabled ( jQueryObject input, bool isEnabled ) : void

Adds or removes the 'disabled' attribute on the given INPUT element.

SpanIndent ( int pixels ) : string

Creates a SPAN element with a magin-left set to the specified pixels (useful for indenting text).

ToBold ( string text ) : string

Wraps the given text in elements.

ToHyperlink ( string url, string text, LinkTarget target ) : string

Formats the URL as a hyperlink.

Width ( string cssSelector ) : int

Retrieves the width of the specified element.

Private Methods

Method Description
ToHyperlink ( string url ) : string

Method Details

Append() public static method

Creates and appends a DIV element within the given parent.
public static Append ( jQueryObject parent, string tag ) : jQueryObject
parent jQueryObject The parent element to insert into
tag string The tag name (NOT including angle brackets).
return jQueryObject

AppendDiv() public static method

Creates and appends a DIV element within the given parent.
public static AppendDiv ( jQueryObject parent ) : jQueryObject
parent jQueryObject The parent element to insert into
return jQueryObject

ChildAt() public static method

Retrieves the child at the specified index, otherwise Null.
public static ChildAt ( int index, jQueryObject parent ) : jQueryObject
index int The index of the child (0-based).
parent jQueryObject The parent to look within.
return jQueryObject

CreateDiv() public static method

Creates a DIV element.
public static CreateDiv ( ) : jQueryObject
return jQueryObject

CreateElement() public static method

Creates a new element with the given tag.
public static CreateElement ( string tag ) : jQueryObject
tag string The HTML tag.
return jQueryObject

CreateImage() public static method

Creates an IMG element.
public static CreateImage ( string src, string alt ) : jQueryObject
src string The URL to the image.
alt string The alternative text for the image.
return jQueryObject

CreateSpan() public static method

Creates a SPAN element.
public static CreateSpan ( ) : jQueryObject
return jQueryObject

GetOrCreateId() public static method

Gets the elements ID, creating a unique ID of the element doesn't already have one.
public static GetOrCreateId ( jQueryObject element ) : string
element jQueryObject The element to get the ID for.
return string

Height() public static method

Retrieves the height of the specified element.
public static Height ( string cssSelector ) : int
cssSelector string The CSS selector of the element to measure.
return int

OuterHtml() public static method

Retreives the OuterHtml of the given element.
public static OuterHtml ( jQueryObject element ) : string
element jQueryObject The element to retrieve the HTML for.
return string

ReplaceWith() public static method

Replaces an element with the given object.
public static ReplaceWith ( string replaceSeletor, jQueryObject withReplacement, bool copyCssClasses ) : void
replaceSeletor string The CSS selector the element(s) to replace.
withReplacement jQueryObject The element to insert.
copyCssClasses bool Flag indicating if CSS classes should be copied from the old element to the new one.
return void

SetDisabled() public static method

Adds or removes the 'disabled' attribute on the given INPUT element.
public static SetDisabled ( jQueryObject input, bool isEnabled ) : void
input jQueryObject The input element to effect.
isEnabled bool The enabled value.
return void

SpanIndent() public static method

Creates a SPAN element with a magin-left set to the specified pixels (useful for indenting text).
public static SpanIndent ( int pixels ) : string
pixels int The number of pixels to indent.
return string

ToBold() public static method

Wraps the given text in elements.
public static ToBold ( string text ) : string
text string The text to wrap.
return string

ToHyperlink() public static method

Formats the URL as a hyperlink.
public static ToHyperlink ( string url, string text, LinkTarget target ) : string
url string The url to link to.
text string The display text of the link (null to use the URL).
target LinkTarget The target attribute.
return string

Width() public static method

Retrieves the width of the specified element.
public static Width ( string cssSelector ) : int
cssSelector string The CSS selector of the element to measure.
return int